mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
parent
70abf3a611
commit
50ca50136d
1 changed files with 13 additions and 7 deletions
|
|
@ -40,14 +40,27 @@ 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";
|
||||
c.DocumentTitle = "FilterLists API";
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseExceptionHandler("/Error");
|
||||
app.UseHsts();
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.SwaggerEndpoint("https://filterlists.com/api/swagger/v1/swagger.json", "FilterLists API V1");
|
||||
c.RoutePrefix = "docs";
|
||||
c.DocumentTitle = "FilterLists API";
|
||||
});
|
||||
}
|
||||
|
||||
app.UseForwardedHeaders(new ForwardedHeadersOptions
|
||||
|
|
@ -58,13 +71,6 @@ 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