3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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
3
3
2

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
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?