Skip to content

Instantly share code, notes, and snippets.

@mdmarek
Created May 6, 2012 17:12
Show Gist options
  • Save mdmarek/2623340 to your computer and use it in GitHub Desktop.
Save mdmarek/2623340 to your computer and use it in GitHub Desktop.
Minimum Wai + Warp Application Server. Compiled with GHC 7.4, Wai 1.1, Warp 1.1 versions.
{-# LANGUAGE OverloadedStrings #-}
-- | Hello world Wai+Warp applicaion server. Used GHC 7.4, Wai 1.1, Warp 1.1 versions.
module Main where
import Network.HTTP.Types (status200)
import Network.Wai (Application,responseLBS)
import Network.Wai.Handler.Warp (run)
-- | Hello word Wai application.
app :: Application
app _ = return $ responseLBS status200 [("Content-Type", "text/plain")] "Hello, Web!"
-- | Start Warp server on port 8080.
main :: IO ()
main = do
putStrLn $ "http://localhost:8080/"
run 8080 app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment