Skip to content

Commit

Permalink
fix: set base url for swagger json (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
arealmaas authored Feb 16, 2024
1 parent 398ec19 commit 2161066
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Digdir.Domain.Dialogporten.WebApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static void BuildAndRun(string[] args)

// Auth
.AddDialogportenAuthentication(builder.Configuration)
.AddAuthorization() // Required for the AllowAnonymousHandler
.AddAuthorization()
.AddHealthChecks();

if (builder.Environment.IsDevelopment())
Expand Down Expand Up @@ -166,6 +166,10 @@ static void BuildAndRun(string[] args)
})
.UseSwaggerGen(config =>
{
// We have to add dialogporten here to get the correct base url for swagger.json in the APIM
// todo: we cannot have dialogporten as prefix when we run this locally. Won't be available on container apps either.
config.Path = "/dialogporten/swagger/{documentName}/swagger.json";

config.PostProcess = (document, _) =>
{
var dialogportenBaseUri = builder.Configuration
Expand Down

0 comments on commit 2161066

Please sign in to comment.