Files
blog.stevanfreeborn.com/src/Blog/Program.cs
T

26 lines
459 B
C#
Raw Normal View History

2024-04-02 15:35:57 -05:00
using Blog.Components;
var builder = WebApplication.CreateBuilder(args);
2024-04-03 12:02:00 -05:00
builder.Services
.AddRazorComponents()
.AddInteractiveServerComponents();
2024-04-02 15:35:57 -05:00
var app = builder.Build();
2024-04-03 12:02:00 -05:00
if (app.Environment.IsProduction())
2024-04-02 15:35:57 -05:00
{
2024-04-03 12:02:00 -05:00
app.UseExceptionHandler("/Error", createScopeForErrors: true);
app.UseHsts();
2024-04-02 15:35:57 -05:00
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseAntiforgery();
2024-04-03 12:02:00 -05:00
app
.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
2024-04-02 15:35:57 -05:00
2024-04-03 12:02:00 -05:00
app.Run();