Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into peggy/3414
Browse files Browse the repository at this point in the history
  • Loading branch information
peggy-quartech committed Dec 5, 2024
2 parents 417fbeb + 64bc06a commit de3575d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 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("/licensing/maintenance/offline.html");
return;
}
await next();
});
app.UseStaticFiles();
app.MapFallbackToFile("index.html");
app.UseRouting();
app.UseObservabilityMiddleware();
app.UseHealthChecks();
Expand Down
6 changes: 4 additions & 2 deletions src/Spd.Presentation.Screening/ClientApp/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
"src/assets",
"src/maintenance"
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
Expand Down Expand Up @@ -105,7 +106,8 @@
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
"src/assets",
"src/maintenance"
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
Expand Down
10 changes: 10 additions & 0 deletions src/Spd.Presentation.Screening/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@
app.UseResponseCaching();
app.UseRequestDecompression();
app.UseResponseCompression();
app.Use(async (context, next) =>
{
var isMaintenance = builder.Configuration.GetValue<bool>("MaintenanceMode"); // Get the value from appsettings.json
if (isMaintenance && !context.Request.Path.Value.Contains("maintenance"))
{
context.Response.Redirect("/screening/maintenance/offline.html");
return;
}
await next();
});
app.UseStaticFiles();
app.MapFallbackToFile("index.html");
app.UseRouting();
Expand Down

0 comments on commit de3575d

Please sign in to comment.