set swagger host before updating route

ref #131
This commit is contained in:
Collin M. Barrett 2018-06-06 21:59:00 -05:00
parent 4ec23d8378
commit e835377af6

View file

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