mirror of
https://github.com/typeable/wai.git
synced 2024-12-26 15:42:18 +03:00
bc26e9bca3
[wai-app-static] Provide sample.hs for actual wai-app-static
18 lines
528 B
Haskell
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"]
|
|
}
|