try specifying swagger basepath for prod

ref #131
This commit is contained in:
Collin M. Barrett 2018-06-07 14:52:22 -05:00
parent 1de6496788
commit 3fd442f2f9
2 changed files with 6 additions and 2 deletions

View file

@ -1,4 +1,5 @@
using System.IO;
using System;
using System.IO;
using Microsoft.ApplicationInsights.Extensibility.Implementation;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.PlatformAbstractions;
@ -26,7 +27,9 @@ private static void AddSwaggerGenCustom(this IServiceCollection services)
Title = "FilterLists API",
Version = "v1",
Description =
"A REST-ish API for FilterLists, the independent, comprehensive directory of all public filter and hosts lists for advertisements, trackers, malware, and annoyances.",
"A REST-ish API for FilterLists, the independent, comprehensive directory of all public filter and hosts lists for advertisements, trackers, malware, and annoyances." +
Environment.NewLine +
" - {version} has to be specified manually in Swagger playground below due to https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/370",
Contact = new Contact
{
Url = "https://github.com/collinbarrett/FilterLists/",

View file

@ -60,6 +60,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
app.UseMvc();
app.UseSwagger(c =>
{
c.PreSerializeFilters.Add((swaggerDoc, httpReq) => swaggerDoc.BasePath = "/api");
c.RouteTemplate = "docs/{documentName}/swagger.json";
UseLowercaseControllerNameInSwaggerHack(c);
});