Created
May 6, 2012 17:12
-
-
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.
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 #-} | |
-- | 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