Skip to content

Commit

Permalink
Add PathBase config option so CDN can be hosted on subpaths.
Browse files Browse the repository at this point in the history
This is only really necessary to fix the HTML builds page, but whatever.

Fixes #6
  • Loading branch information
PJB3005 committed Jul 21, 2024
1 parent 200799e commit d582607
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Robust.Cdn/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@

var app = builder.Build();

var pathBase = app.Configuration.GetValue<string>("PathBase");
if (!string.IsNullOrEmpty(pathBase))
{
app.Services.GetRequiredService<ILogger<Program>>().LogInformation("Using PathBase: {PathBase}", pathBase);
app.UsePathBase(pathBase);
}

app.UseRouting();

// Make sure SQLite cleanly shuts down.
app.Lifetime.ApplicationStopped.Register(SqliteConnection.ClearAllPools);

Expand Down

0 comments on commit d582607

Please sign in to comment.