Skip to content

Instantly share code, notes, and snippets.

@mdmarek
Created May 13, 2012 22:06
Show Gist options
  • Save mdmarek/2690449 to your computer and use it in GitHub Desktop.
Save mdmarek/2690449 to your computer and use it in GitHub Desktop.
Haskell web application to serve static files.
{-# 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