-
Notifications
You must be signed in to change notification settings - Fork 6
Home
wai-devel is a development server for wai compliant haskell web applications.
Its name changed from yesod-devel (the haskell reddit community suggested this).
NOTHING Yes, wai-devel expects nothing from your application. However, your application shall receive a port number through the environment variable PORT.
What PORT is used for:
Your application shall listen for connections on localhost: wai-devel by default creates a reverse proxy from port number 3000 to your application which is listening in on PORT. You can change the port from the default port 3000 by setting the environment variable PORT yourself.
wai-devel takes PORT and then cycles through various port numbers adding 1 to PORT to find a port that is free, sets that as the destination port and changes the PORT environment variable to that destination port. Therefore we can reverse proxy from PORT to a random port.
Reverse proxying is important for error reporting, future proofing and other ways of abstracting away the services wai-devel provides to your application.
Currently wai-devel has been tested and used with stack. Support for use with the cabal-install binary is underway.
Thanks to it's dependence on stack you can pass the STACK_YAML=... variable to wai-devel, for example: STACK_YAML=stack-7.10 wai-devel
Currently wai-devel is built and tested against:
- GHC-7.8
- GHC-7.10
wai-devel uses the the module you have chosen (e.g Application) to find the files to watch for changes in. It watches the files it imports and their Template Haskell dependencies as well as the cabal file.
-
-r to turn off reverse proxying
-
--show-iface [hi file] passes this command to ghc Same as ghc --show-iface
-
-p Path to the file with the function you want to run defaults to Application.hs
-
-f The function you want to run defaults to develMain