-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathProgram.cs
More file actions
30 lines (22 loc) · 815 Bytes
/
Program.cs
File metadata and controls
30 lines (22 loc) · 815 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
using System.Web;
using Microsoft.AspNetCore.OutputCaching;
using ModulesLibrary;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSystemWebAdapters()
.AddHttpApplication(options =>
{
// Size of pool for HttpApplication instances. Should be what the expected concurrent requests will be
options.PoolSize = 10;
// These have a bit of a cost to them, so only enable if you need them
options.ArePreSendEventsEnabled = true;
// Register a module by name
options.RegisterModule<EventsModule>("Events");
});
builder.Services.AddOutputCache(options =>
{
options.AddHttpApplicationBasePolicy(_ => new[] { "browser" });
});
var app = builder.Build();
app.UseSystemWebAdapters();
app.MapGet("/", () => "Hello World!\n");
app.Run();