Fix published web UI content root
This commit is contained in:
1 parent
b31e9a7261
commit
d9165a60ff
1 file changed
+7
@@ -4,7 +4,14 @@ using Gateway.Api.Domain;
|
|||||||
using Gateway.Api.Options;
|
using Gateway.Api.Options;
|
||||||
using Gateway.Api.Services;
|
using Gateway.Api.Services;
|
||||||
|
|
||||||
|
// The service keeps its mutable data in /var/lib/seiugw on NixOS. Static web
|
||||||
|
// assets, however, are published beside this executable in the immutable Nix
|
||||||
|
// store. Explicitly use the executable directory as the content/web root so
|
||||||
|
// the web UI is available no matter which working directory systemd uses.
|
||||||
|
var applicationRoot = AppContext.BaseDirectory;
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
builder.WebHost.UseContentRoot(applicationRoot);
|
||||||
|
builder.WebHost.UseWebRoot(Path.Combine(applicationRoot, "wwwroot"));
|
||||||
builder.Services.Configure<GatewayOptions>(builder.Configuration.GetSection("Gateway"));
|
builder.Services.Configure<GatewayOptions>(builder.Configuration.GetSection("Gateway"));
|
||||||
builder.Services.ConfigureHttpJsonOptions(options => options.SerializerOptions.Converters.Add(new JsonStringEnumConverter()));
|
builder.Services.ConfigureHttpJsonOptions(options => options.SerializerOptions.Converters.Add(new JsonStringEnumConverter()));
|
||||||
builder.Services.AddSingleton<GatewayDatabase>();
|
builder.Services.AddSingleton<GatewayDatabase>();
|
||||||
|
|||||||
Reference in new issue
Block a user