1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-09 00:41:37 +01:00

set swagger host

This commit is contained in:
Kyle Spearrin 2019-03-08 16:21:37 -05:00
parent 61f473390f
commit 14ecb8af93

View File

@ -191,11 +191,14 @@ namespace Bit.Api
// Add MVC to the request pipeline. // Add MVC to the request pipeline.
app.UseMvc(); app.UseMvc();
// Add Swagger
if(Environment.IsDevelopment() || globalSettings.SelfHosted) if(Environment.IsDevelopment() || globalSettings.SelfHosted)
{ {
app.UseSwagger(config => app.UseSwagger(config =>
{ {
config.RouteTemplate = "specs/{documentName}/swagger.json"; config.RouteTemplate = "specs/{documentName}/swagger.json";
config.PreSerializeFilters.Add(
(swaggerDoc, httpReq) => swaggerDoc.Host = globalSettings.BaseServiceUri.Api);
}); });
app.UseSwaggerUI(config => app.UseSwaggerUI(config =>
{ {