1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-03 23:51:21 +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.
app.UseMvc();
// Add Swagger
if(Environment.IsDevelopment() || globalSettings.SelfHosted)
{
app.UseSwagger(config =>
{
config.RouteTemplate = "specs/{documentName}/swagger.json";
config.PreSerializeFilters.Add(
(swaggerDoc, httpReq) => swaggerDoc.Host = globalSettings.BaseServiceUri.Api);
});
app.UseSwaggerUI(config =>
{