on master help sign in
Merge pull request #240 from sol/master

wai: Update README

commitca3411cca16a6253f1db634de87bb04596a82e35 authorKazu Yamamoto <kazu@iij.ad.jp> dateSun 30 Mar 2014, 11:43 (13 years ago) parentdff5fc64e4b07b
1 file changed+4−3
wai/README.md+4−3
wai/README.md+4−3
@@ -11,12 +11,10 @@ You want a minimal example? Here it is!
1111import Network.Wai
1212import Network.HTTP.Types
1313import Network.Wai.Handler.Warp (run)
14−import Data.ByteString.Lazy.Char8 () -- Just for an orphan instance
15−import Control.Monad.IO.Class (liftIO)
1614
1715app :: Application
1816app _ = do
19− liftIO $ putStrLn "I've done some IO here"
17+ putStrLn "I've done some IO here"
2018 return $ responseLBS
2119 status200
2220 [("Content-Type", "text/plain")]
@@ -54,6 +52,7 @@ Now we redefine `responseBody` to refer to that file:
5452app2 :: Application
5553app2 _ = return index
5654
55+index :: Response
5756index = responseFile
5857 status200
5958 [("Content-Type", "text/html")]
@@ -79,12 +78,14 @@ app3 request = case rawPathInfo request of
7978 "/raw/" -> return plainIndex
8079 _ -> return notFound
8180
81+plainIndex :: Response
8282plainIndex = responseFile
8383 status200
8484 [("Content-Type", "text/plain")]
8585 "index.html"
8686 Nothing
8787
88+notFound :: Response
8889notFound = responseLBS
8990 status404
9091 [("Content-Type", "text/plain")]