-
Notifications
You must be signed in to change notification settings - Fork 56
Change templates to use environment variable for urls. #574
Comments
I think templates should use the following, instead of hardcoding UseUrls(Environment.GetEnvironmentVariable("ASPNETCORE_URLS")) If the environment variable is not set, then |
What would be the experience if you have a team and some use VS and others editors like VS Code or Notepad++? |
@sayedihashimi I think for non-docker scenarios, we wouldn't set the environment variable and then hosting would just use localhost:5000 like Mike mentioned, thus keeping the same behavior we have today. Docker would set the environment variable for their runtime scenario. |
Correct, there should be no difference from current behavior if the environment variable is not set. We didn't want to add a fixed environment variable for this in the framework itself (in part because it's not discoverable), but it seems reasonable in a template, and serves as documentation for how to change the URL. |
I see so this is independent of IIS Express, I missed that part. |
This isn't needed now that WebHostBuilder will read the variable itself instead of having to have it passed in. @mikeharder I was fairly sure UseUrls throws if is passed null. We could change that of course. |
Uh oh!
There was an error while loading. Please reload this page.
This will allow the Docker tools team to not modify user code after a new app is created.
The text was updated successfully, but these errors were encountered: