26 lines
714 B
C#
26 lines
714 B
C#
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddRazorPages();
|
|
builder.Services.AddControllersWithViews();
|
|
builder.Services.AddRouting(options => options.LowercaseUrls = true);
|
|
|
|
WebApplication app = builder.Build();
|
|
|
|
if (!app.Environment.IsDevelopment())
|
|
{
|
|
app.UseExceptionHandler("/Error");
|
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|
app.UseHsts();
|
|
}
|
|
|
|
app.UseHttpsRedirection();
|
|
app.UseStaticFiles();
|
|
app.UseRouting();
|
|
app.UseAuthorization();
|
|
|
|
app.MapControllers();
|
|
app.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
|
|
app.MapRazorPages();
|
|
|
|
app.Run();
|