// 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>();

// Static site
app.UseDefaultFiles();
app.UseStaticFiles();

app.MapReverseProxy();

app.Run();
