Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
peggy-quartech committed Dec 5, 2024
1 parent 98e6414 commit b242dbd
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/Spd.Presentation.Licensing/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,18 @@
app.UseResponseCaching();
app.UseRequestDecompression();
app.UseResponseCompression();
app.UseStaticFiles();
if (app.Configuration.GetValue("MaintenanceMode", false))
{
app.MapFallbackToFile("maintenance/offline.html");
}
else
app.Use(async (context, next) =>
{
app.MapFallbackToFile("index.html");
}
var isMaintenance = builder.Configuration.GetValue<bool>("MaintenanceMode"); // Get the value from appsettings.json
if (isMaintenance && !context.Request.Path.Value.Contains("maintenance"))
{
context.Response.Redirect("/maintenance/offline.html");
return;
}
await next();
});
app.UseStaticFiles();
app.MapFallbackToFile("index.html");
app.UseRouting();
app.UseObservabilityMiddleware();
app.UseHealthChecks();
Expand Down

0 comments on commit b242dbd

Please sign in to comment.