Created
May 13, 2012 22:06
-
-
Save mdmarek/2690449 to your computer and use it in GitHub Desktop.
Haskell web application to serve static files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
-- | Wai+Warp file server. Used GHC 7.4, Wai 1.1, Warp 1.1 versions. | |
module Main where | |
import Network.Wai.Handler.Warp (run) | |
import Network.Wai.Application.Static | |
( StaticSettings(..) | |
, staticApp | |
, fileSystemLookup | |
, defaultWebAppSettings ) | |
-- | Start Warp server on port 8080. | |
main :: IO () | |
main = do | |
putStrLn $ "http://*:8080/" | |
run 8080 $ staticApp defaultWebAppSettings | |
{ ssFolder = fileSystemLookup "/home/ubuntu/tomugen.com" | |
, ssIndices = ["index.html"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment