mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
parent
b309027fe1
commit
e9a23ddfb8
2 changed files with 11 additions and 14 deletions
|
|
@ -40,27 +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";
|
||||
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
|
||||
|
|
@ -71,6 +58,16 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
|
|||
app.UseStaticFiles();
|
||||
app.UseCookiePolicy();
|
||||
app.UseMvc();
|
||||
app.UseSwagger(UseLowercaseControllerNameInSwaggerHack);
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.SwaggerEndpoint(
|
||||
env.IsDevelopment()
|
||||
? "/../swagger/v1/swagger.json"
|
||||
: "https://filterlists.com/api/swagger/v1/swagger.json", "FilterLists API V1");
|
||||
c.RoutePrefix = "docs";
|
||||
c.DocumentTitle = "FilterLists API";
|
||||
});
|
||||
MigrateAndSeedDatabase(app);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ namespace FilterLists.Api.V1.Controllers
|
|||
{
|
||||
[ApiVersion("1.0")]
|
||||
//https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/370
|
||||
[Route("v{version:apiVersion}/[controller]")]
|
||||
[Route("api/v{version:apiVersion}/[controller]")]
|
||||
public class BaseController : Controller
|
||||
{
|
||||
protected readonly SeedService SeedService;
|
||||
|
|
|
|||
Loading…
Reference in a new issue