33 lines
856 B
C#
33 lines
856 B
C#
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
|
using Library;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
builder.Services
|
|
.Configure<KestrelServerOptions>( builder.Configuration.GetSection( "Kestrel" ) )
|
|
// .Configure<FormOptions>( x => { x.ValueLengthLimit = int.MaxValue; x.MultipartBodyLengthLimit = int.MaxValue; x.MultipartHeadersLengthLimit = int.MaxValue; } )
|
|
.AddControllersWithViews( )
|
|
.AddRazorRuntimeCompilation( );
|
|
|
|
var app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (!app.Environment.IsDevelopment())
|
|
{
|
|
app.UseExceptionHandler("/Home/Error");
|
|
}
|
|
app.UseStaticFiles();
|
|
|
|
app.UseMiddleware<ExceptionMiddleware>( );
|
|
|
|
app.UseRouting();
|
|
|
|
app.UseAuthorization();
|
|
|
|
app.MapControllerRoute(
|
|
name: "default",
|
|
pattern: "{controller=Home}/{action=Index}/{id?}");
|
|
|
|
app.Run();
|