try another relative Swagger endpoint workaround

ref #131
This commit is contained in:
Collin Barrett 2018-06-06 19:48:38 -05:00
parent 4460ced649
commit 17b2869789

View file

@ -40,26 +40,31 @@ 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
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
app.UseSwagger(UseLowercaseControllerNameInSwaggerHack);
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "FilterLists API V1");
c.RoutePrefix = "docs";
});
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseCookiePolicy();