SAFE-Stack / SAFE-template

dotnet CLI template for SAFE project
MIT License
282 stars 88 forks source link

Dotnet run opens the wrong URL #460

Closed inputusernamehere closed 2 years ago

inputusernamehere commented 3 years ago

After creating a new project with the template, running the command dotnet run results in my browser opening a tab with the url http://0.0.0.0:8085/. However this is the backend's URL. Shouldn't it open the client instead, at :8080?

theprash commented 3 years ago

The template stopped automatically opening a browser tab a while back because it's annoying while working on a project when you already have the browser tab ready to go.

Do you use Visual Studio? It creates launchSettings.json with "launchBrowser": true. This then causes dotnet to launch the browser on run. I'm not sure how to correct the port here but you can at least change launchBrowser to false.

inputusernamehere commented 3 years ago

Ahh must be the case yeah, I do indeed have a launchSettings.json file with "launchBrowser": true. Case solved. Maybe it would be better for the template to include a launcSettings.json where that setting is set to false?

isaacabraham commented 3 years ago

@theprash I've seen this too. Either including a file that stops this happening, or including documentation to explain this, would be my suggestion.

theprash commented 2 years ago

I found a better fix for this issue than including a default file. You can add <NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile to Server.fsproj. I opened PR #523 to make this change to both default and minimal templates.

theprash commented 2 years ago

Actually cancel that (my last comment). If we remove the file then the environment is defaulted to Production while running in dev. So I've opened PR #524 to add launchSettings.json to the minimal template as well.