on master help sign in
Fixed README
commit1b99c31a66800c36f98f21ea946b1ae72f988bfb authorMichael Snoyman <michael@snoyman.com> dateThu 14 Apr 2011, 17:52 (16 years ago) parent0894610
2 files changed+8−2
README.lhs+4−1 README.md+4−1
README.lhs+4−1
@@ -8,6 +8,7 @@ You want a minimal example? Here it is!
88
99> {-# LANGUAGE OverloadedStrings #-}
1010> import Network.Wai
11+> import Network.HTTP.Types
1112> import Network.Wai.Handler.Warp (run)
1213> import Data.ByteString.Lazy.Char8 () -- Just for an orphan instance
1314>
@@ -53,6 +54,7 @@ Now we redefine `responseBody` to refer to that file:
5354> status200
5455> [("Content-Type", "text/html")]
5556> "index.html"
57+> Nothing
5658
5759
5860Basic dispatching
@@ -67,7 +69,7 @@ Depending on the path info provided with each `Request` we can serve
6769different `Response`s:
6870
6971> app3 :: Application
70−> app3 request = case pathInfo request of
72+> app3 request = case rawPathInfo request of
7173> "/" -> return index
7274> "/raw/" -> return plainIndex
7375> _ -> return notFound
@@ -76,6 +78,7 @@ different `Response`s:
7678> status200
7779> [("Content-Type", "text/plain")]
7880> "index.html"
81+> Nothing
7982>
8083> notFound = responseLBS
8184> status404
README.md+4−1
@@ -9,6 +9,7 @@ You want a minimal example? Here it is!
99
1010 {-# LANGUAGE OverloadedStrings #-}
1111 import Network.Wai
12+ import Network.HTTP.Types
1213 import Network.Wai.Handler.Warp (run)
1314 import Data.ByteString.Lazy.Char8 () -- Just for an orphan instance
1415
@@ -52,6 +53,7 @@ Now we redefine `responseBody` to refer to that file:
5253 status200
5354 [("Content-Type", "text/html")]
5455 "index.html"
56+ Nothing
5557
5658
5759Basic dispatching
@@ -65,7 +67,7 @@ An `Application` maps `Request`s to `Response`s:
6567Depending on the path info provided with each `Request` we can serve different `Response`s:
6668
6769 app3 :: Application
68− app3 request = case pathInfo request of
70+ app3 request = case rawPathInfo request of
6971 "/" -> return index
7072 "/raw/" -> return plainIndex
7173 _ -> return notFound
@@ -74,6 +76,7 @@ Depending on the path info provided with each `Request` we can serve different `
7476 status200
7577 [("Content-Type", "text/plain")]
7678 "index.html"
79+ Nothing
7780
7881 notFound = responseLBS
7982 status404