if (env.IsDevelopment())
app.UseDeveloperExceptionPage();
else
app.UseExceptionHandler("/CubeHome/Error");
app.UseStaticHttpContext();
var set = Setting.Current;
if (set.EnableCompress) app.UseResponseCompression();
app.UseStaticFiles();
app.UseCookiePolicy();
app.UseSession();
app.UseMiddleware<RunTimeMiddleware>();
if (set.WebOnline || set.WebBehavior || set.WebStatistics) app.UseMiddleware<UserBehaviorMiddleware>();
if (set.SslMode > SslModes.Disable) app.UseHttpsRedirection();
app.UseAuthentication();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
"CubeAreas",
"{area}/{controller=Index}/{action=Index}/{id?}");
endpoints.MapControllerRoute(
"Default",
"{controller=Home}/{action=Index}/{id?}"
);
endpoints.MapRazorPages();
})
.Build();
app.UseManagerProvider();
AreaBase.RegisterArea<NewLife.Cube.Admin.AdminArea>();