scotty-web / scotty

Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp (Official Repository)
http://hackage.haskell.org/package/scotty
BSD 3-Clause "New" or "Revised" License
1.72k stars 134 forks source link

Question: What does "Scotty is set up by default for development mode" mean? #213

Closed ThomasLocke closed 5 years ago

ThomasLocke commented 6 years ago

While working on my first Scotty project, I noticed the above sentence early in the stackage.org docs:

https://www.stackage.org/haddock/lts-10.5/scotty-0.11.0/Web-Scotty.html

Scotty is set up by default for development mode. For production servers, you will likely want to modify settings and the defaultHandler. See the comments on each of these functions for more information.

I get the need to set the defaultHandler but I can't quite figure out what needs to be changed in settings in order to go from "development" to "production".

To my untrained eye, the default settings seems quite sane and fine for a production server.

Or am I missing something?

mordae commented 5 years ago

Citing the docs:

Note: to work around an issue in warp, the default FD cache duration is set to 0 so changes to static files are always picked up. This likely has performance implications, so you may want to modify this for production servers using setFdCacheDuration.

ThomasLocke commented 5 years ago

And with that out of the way, I think we can safely close this "issue". :)