10

Is there a way to start a http server to serve static files right from shell using ghc -e or runhaskell ?

Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187
Shanthakumar
  • 757
  • 6
  • 23

2 Answers2

15

The wai-app-static package ships with an executable named warp. This can be run from the command line to get a static file server. You can look at its implementation to see how you can reimplement that behavior from runhaskell.

Michael Snoyman
  • 31,100
  • 3
  • 48
  • 77
0

https://hackage.haskell.org/package/hserv is also an option, this also uses wai-app-static.

cabal install hserve and run hserv.

Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286