giraffe-fsharp / giraffe-template

A dotnet new template for Giraffe web applications.
Apache License 2.0
37 stars 22 forks source link

Mention that ASPNETCORE_ENVIRONMENT defaults to Production #40

Closed LiteracyFanatic closed 3 years ago

LiteracyFanatic commented 3 years ago

If ASPNETCORE_ENVIRONMENT is unset it defaults to Production. Testing out the API with something like curl http://localhost:5000/api/hello will then output nothing without raising an error from curl or the server due to the call to UseHttpsRedirection(). The situation becomes evident if one thinks to pass -v or -L to curl, but it took me longer to figure out than I'd care to admit. A mention of the need to explicitly set ASPNETCORE_ENVIRONMENT=Development in README.md and/or the comments in the template itself could solve the issue. This is probably fairly obvious to those with more knowledge of ASP.NET than myself, but I thought I'd bring it up since this is now the second time I've managed to trip over it while setting up a new project.

dustinmoris commented 3 years ago

That's a good point. Do you want to provide a PR with a mention in the places where you feel it would have stood out to you?

LiteracyFanatic commented 3 years ago

Sure thing. I've opened PR #41.