LoginSignup
3

More than 5 years have passed since last update.

Haskell版フォルダを指定してhttpで公開する簡易Webサーバー

Last updated at Posted at 2016-05-03
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

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3