blazor-mcp / Program.cs
Loresayer's picture
Preliminary copying into HF Docker Space of ''hello world'' Blazor web client
79f7e9a
using Blazor.Components;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error", createScopeForErrors: true);
app.UseHsts();
}
app.UseStatusCodePagesWithReExecute("/not-found",
createScopeForStatusCodePages: true);
// Not needed in Hugging Face Spaces because HF handles TLS termination.
// app.UseHttpsRedirection();
app.UseAntiforgery();
app.MapStaticAssets();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.Run();