Add explanation how to run local web server#119
Conversation
| Running this executable with `cabal run web` will start a web server listening on | ||
| `0.0.0.0:8000`. You should be able to see the web page by opening | ||
| <http://localhost:8000> in a web browser. _Note_ that you will need to run | ||
| `cabal run web` within this current directory. |
There was a problem hiding this comment.
Ah, this is presumably because runApp refers to style.css by relative path. There should be some way around this. Maybe using file-embed?
There was a problem hiding this comment.
Yeah, we could use something like file-embed to do this. I figured just explaining it in the documentation was the easiest thing to do here, but we could always improve it in the future it ends up being annoying.
| runApp :: JSM () -> IO () | ||
| runApp f = | ||
| runApp f = do | ||
| putStrLn "Web server running on 0.0.0.0:8000..." |
There was a problem hiding this comment.
Out of interest, why 0.0.0.0 instead of localhost?
There was a problem hiding this comment.
It appears that by default warp actually does listen on all interfaces (0.0.0.0), and not just localhost. So I felt this message was "more correct", although I guess some developers might not know that 0.0.0.0 means they can connect by accessing http://127.0.0.1:8000.
This PR is for #116. It just adds a simple explanation of how to run a local web server.