server.hs
module Main where
import Network.Wai.Application.Static
import Network.Wai.Handler.Warp
port = 3001
dir = "/path/to/public"
main = run port $ staticApp $ defaultFileServerSettings dir
実行方法
$ stack install wai-app-static warp # Install dependencies
$ stack runghc server.hs # Start server