Skip to content
Snippets Groups Projects
Commit 3c1ef619 authored by Lucca Santangelo's avatar Lucca Santangelo
Browse files

updates

parent 821ed085
No related branches found
No related tags found
1 merge request!26Develop
......@@ -20,4 +20,5 @@ WORKDIR /app
RUN mkdir /app/StaticFiles
COPY --from=build /app/publish .
EXPOSE 5000
VOLUME [ "/app/StaticFiles" ]
ENTRYPOINT ["dotnet", "Tsi1.Api.dll"]
\ No newline at end of file
......@@ -26,6 +26,7 @@ using Tsi1.BusinessLayer.Services;
using Tsi1.BusinessLayer.DataLoad;
using Tsi1.DataLayer;
using Tsi1.DataLayer.MongoDbConfiguration;
using System.Collections.Generic;
namespace Tsi1.Api
{
......@@ -190,7 +191,19 @@ namespace Tsi1.Api
app.UseDeveloperExceptionPage();
}
app.UseSwagger();
app.UseSwagger(c =>
{
c.PreSerializeFilters.Add((swaggerDoc, httpRequest) =>
{
if (!httpRequest.Headers.ContainsKey("X-Forwarded-Host")) { return; }
var serverUrl = $"{httpRequest.Headers["X-Forwarded-Proto"]}://" +
$"{httpRequest.Headers["X-Forwarded-Host"]}/" +
$"{httpRequest.Headers["X-Forwarded-Prefix"]}";
swaggerDoc.Servers = new List<OpenApiServer>() { new OpenApiServer { Url = serverUrl } };
});
});
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "Tsi1 api V1");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment