| 1 |
using Blog.Components; |
| 2 |
using Microsoft.AspNetCore.Builder; |
| 3 |
using Microsoft.Extensions.DependencyInjection; |
| 4 |
using Microsoft.Extensions.Hosting; |
| 5 |
|
| 6 |
var builder = WebApplication.CreateBuilder(args); |
| 7 |
|
| 8 |
|
| 9 |
builder.Services.AddRazorComponents(); |
| 10 |
|
| 11 |
var app = builder.Build(); |
| 12 |
|
| 13 |
|
| 14 |
if (!app.Environment.IsDevelopment()) |
| 15 |
{ |
| 16 |
app.UseExceptionHandler("/Error", createScopeForErrors: true); |
| 17 |
|
| 18 |
app.UseHsts(); |
| 19 |
} |
| 20 |
|
| 21 |
app.UseHttpsRedirection(); |
| 22 |
|
| 23 |
app.UseAntiforgery(); |
| 24 |
|
| 25 |
app.MapStaticAssets(); |
| 26 |
app.MapRazorComponents<App>(); |
| 27 |
|
| 28 |
app.Run(); |