Code · 32 lines · 575 bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32using VanDerHeijden.JsonBodyProvider;

var builder = WebApplication.CreateBuilder(new WebApplicationOptions
{
	// the 'real' root of the application
	ContentRootPath = AppDomain.CurrentDomain.BaseDirectory
});

builder.Services.AddMvcCore();

builder.Services.AddJsonBodyProvider(
	CorrectLists: true, 
	ParseCookies: true, 
	ParseHeaders: true);

builder.Services.AddDistributedMemoryCache();

builder.Services.AddSession();

var app = builder.Build();

app.UseRouting();

app.UseSession();

app.UseDefaultFiles();

app.UseStaticFiles();

app.MapControllers();

app.Run();