Add the following configuration to your appsettings.json
file to define Kestrel endpoints:
{
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://localhost:5000"
},
"Https": {
"Url": "https://localhost:5001"
}
}
}
}
You can also specify the endpoint directly in Program.cs
:
await app.RunAsync("http://localhost:5000");
For more details, refer to the official Microsoft documentation:
Configure Endpoints in ASP.NET Core Kestrel Web Server
ยฉ 2025 juniyunapapa@gmail.com.