Files
myAi/web/Program.cs
T
claude 0154b56881 Add auto-incrementing version display to web UI footer
Exposes GET /version endpoint in the web container (reads APP_VERSION env var).
CI computes the version as 1.0.<git-commit-count> and passes it via --build-arg at build time.
Both index.html and cv-matcher/index.html show the version in the footer via a JS fetch.
docker-compose passes APP_VERSION through to the running container.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 20:18:31 +03:00

27 lines
642 B
C#

// Program.cs
using Web.Middleware;
using Web.Settings;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRouting();
builder.Services.Configure<SiteSettings>(builder.Configuration.GetSection(SiteSettings.SectionName));
builder.Services.AddReverseProxy()
.LoadFromConfig(builder.Configuration.GetSection("ReverseProxy"));
var app = builder.Build();
app.UseMiddleware<SiteModeMiddleware>();
app.MapGet("/version", (IConfiguration config) =>
Results.Json(new { version = config["APP_VERSION"] ?? "unknown" }));
// Static site
app.UseDefaultFiles();
app.UseStaticFiles();
app.MapReverseProxy();
app.Run();