2 using System.Collections.Generic;
5 using System.Threading.Tasks;
7 using DinkToPdf.Contracts;
8 using Microsoft.AspNetCore.Builder;
9 using Microsoft.AspNetCore.Hosting;
10 using Microsoft.AspNetCore.HttpsPolicy;
11 using Microsoft.AspNetCore.Mvc;
12 using Microsoft.Extensions.Configuration;
13 using Microsoft.Extensions.DependencyInjection;
14 using Microsoft.Extensions.Logging;
15 using Microsoft.Extensions.Options;
16 using PdfService.Utility;
22 public Startup(IConfiguration configuration)
24 Configuration = configuration;
27 public IConfiguration Configuration { get; }
29 // This method gets called by the runtime. Use this method to add services to the container.
30 public void ConfigureServices(IServiceCollection services)
32 services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
34 services.AddSingleton(typeof(IConverter), new SynchronizedConverter(new PdfTools()));
37 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
38 public void Configure(IApplicationBuilder app, IHostingEnvironment env)
40 if (env.IsDevelopment())
42 app.UseDeveloperExceptionPage();
46 // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
50 app.UseHttpsRedirection();