wai/wai-app-static/sample.hs
0xAX bc26e9bca3 Update sample.hs
[wai-app-static] Provide sample.hs for actual wai-app-static
2014-07-05 20:16:29 +06:00

18 lines
528 B
Haskell

{-# LANGUAGE OverloadedStrings #-}
import Data.String
import Data.Text (pack)
import Data.Maybe (mapMaybe)
import WaiAppStatic.Types (ssIndices, toPiece)
import Network.Wai.Application.Static (staticApp,defaultFileServerSettings)
import Network.Wai.Handler.Warp (runSettings, settingsPort, defaultSettings)
main :: IO ()
main = runSettings defaultSettings
{
settingsPort = 3000
} $ staticApp (defaultFileServerSettings $ fromString ".")
{
ssIndices = mapMaybe (toPiece . pack) ["index.html"]
}