A simple project to setup aspnet listen urls from different sources.
Powershell command:
PS> dotnet run --project .\src\Sample\
The urls to bind will be loaded from the key server.urls
in the json file.
{
"server.urls": "http://127.0.0.1:5002"
}
First define the environment variable
Powershell command:
PS> $env:SAMPLE_URLS = "http://127.0.0.1:5003"
Then run the application
Powershell command:
PS> dotnet run --project .\src\Sample\
Remember to clean the variable to avoid unexpected behavior in others tests
Powershell command:
PS> $env:SAMPLE_URLS = ""
Powershell command:
PS> dotnet run --project .\src\Sample\ --server.urls="http://127.0.0.1:5004"