mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
parent
17b2869789
commit
248e7ddc80
3 changed files with 8 additions and 13 deletions
|
|
@ -11,7 +11,6 @@ public static class ConfigureServicesCollection
|
|||
public static void AddFilterListsApi(this IServiceCollection services)
|
||||
{
|
||||
services.AddRouting(options => options.LowercaseUrls = true);
|
||||
services.AddMvcCore();
|
||||
services.AddApiVersioning();
|
||||
services.AddSwaggerGenCustom();
|
||||
TelemetryDebugWriter.IsTracingDisabled = true;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public static void Main(string[] args)
|
|||
}
|
||||
|
||||
private static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args)
|
||||
.UseUrls("http://localhost:5000;")
|
||||
.UseUrls("http://localhost:5000")
|
||||
.UseApplicationInsights()
|
||||
.UseStartup<Startup>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,25 +40,14 @@ public void ConfigureServices(IServiceCollection services)
|
|||
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
|
||||
{
|
||||
app.UseSwagger(UseLowercaseControllerNameInSwaggerHack);
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "FilterLists API V1");
|
||||
c.RoutePrefix = "docs";
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseExceptionHandler("/Error");
|
||||
app.UseHsts();
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.SwaggerEndpoint("/api/swagger/v1/swagger.json", "FilterLists API V1");
|
||||
c.RoutePrefix = "docs";
|
||||
});
|
||||
}
|
||||
|
||||
app.UseForwardedHeaders(new ForwardedHeadersOptions
|
||||
|
|
@ -69,6 +58,13 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
|
|||
app.UseStaticFiles();
|
||||
app.UseCookiePolicy();
|
||||
app.UseMvc();
|
||||
app.UseSwagger(UseLowercaseControllerNameInSwaggerHack);
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "FilterLists API V1");
|
||||
c.RoutePrefix = "docs";
|
||||
c.DocumentTitle = "FilterLists API";
|
||||
});
|
||||
MigrateAndSeedDatabase(app);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue