update TWA Management v0.0.1
This commit is contained in:
@ -1,8 +1,29 @@
|
||||
|
||||
using AppLibs.Libs;
|
||||
using AppLibs.Libs;
|
||||
using Microsoft.AspNetCore.Http.Features;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
|
||||
await WSNavigation.LoadJson();
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.Configure<FormOptions>(o => {
|
||||
o.MultipartBodyLengthLimit = 200_000_000; // 200 MB
|
||||
});
|
||||
builder.Services.AddControllers(options =>
|
||||
{
|
||||
options.Filters.Add<AsyncGateAttribute>();
|
||||
}).AddJsonOptions(options =>
|
||||
{
|
||||
options.JsonSerializerOptions.PropertyNamingPolicy = null;
|
||||
options.JsonSerializerOptions.PropertyNameCaseInsensitive = true;
|
||||
});
|
||||
builder.Services.AddDistributedMemoryCache(); // IDistributedCache in-memory
|
||||
builder.Services.AddSession(o =>
|
||||
{
|
||||
o.IdleTimeout = TimeSpan.FromHours(8);
|
||||
o.Cookie.HttpOnly = true;
|
||||
o.Cookie.IsEssential = true;
|
||||
o.Cookie.SecurePolicy = CookieSecurePolicy.Always;
|
||||
});
|
||||
builder.Services.AddControllersWithViews().AddRazorRuntimeCompilation();
|
||||
|
||||
// Add services to the container.
|
||||
@ -23,11 +44,10 @@ app.UseRouting();
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapStaticAssets();
|
||||
|
||||
app.UseSession();
|
||||
app.MapControllerRoute(
|
||||
name: "default",
|
||||
pattern: "{controller=Home}/{action=Index}/{id?}")
|
||||
.WithStaticAssets();
|
||||
|
||||
|
||||
app.Run();
|
||||
|
||||
Reference in New Issue
Block a user