- Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathProgram.cs
21 lines (16 loc) · 531 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
varbuilder=WebApplication.CreateBuilder();
builder.WebHost.ConfigureKestrel(k =>
{
k.ListenLocalhost(8111);
k.ListenLocalhost(8112);
});
varapp=builder.Build();
app.MapGet("/",async context =>
{
awaitcontext.Response.WriteAsync("hello world from http://localhost:8111");
}).WithMetadata(newHostAttribute("localhost:8111"));
app.MapGet("/",async context =>
{
awaitcontext.Response.WriteAsync("hello world from http://localhost:8112");
}).WithMetadata(newHostAttribute("localhost:8112"));
app.Run();