LoginDing / Program.cs
Code · 32 lines · 654 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 LoginDing.Extensions;

var builder = WebApplication.CreateBuilder(new WebApplicationOptions
{
	ContentRootPath = AppContext.BaseDirectory
});

builder.Services.AddMvcCore().WithMultiParameterModelBinding();

builder.Services.AddRazorUnderRoot();

builder.Services.AddControllersWithViews();

builder.Services.AddAuthenticationAndAddAuthorization();

//builder.Host.UseWindowsService();

builder.Services.AddLogging(logging => logging.AddConsole());

var app = builder.Build();

app.UseDefaultFiles();

app.UseStaticFiles();

app.UseAuthenticationAndAddAuthorization();

app.MapDefaultControllerRoute();

app.MapRazorPages();

await app.RunAsync();