2import Network.Wai.Handler.SimpleServer
3import qualified Data.ByteString.Char8 as B8
4import qualified Data.ByteString as B
7main = putStrLn "http://localhost:3000/" >> run 3000 app
10app req = case B8.unpack $ pathInfo req of
11 "/post/" -> postResponse $ requestBody req
14indexResponse :: IO Response
15indexResponse = return Response
17 , statusMessage = B8.pack "OK"
18 , headers = [(B8.pack "Content-Type", B8.pack "text/html")]
22postResponse :: IO (Maybe B.ByteString) -> IO Response
23postResponse rb = return Response
25 , statusMessage = B8.pack "OK"
26 , headers = [(B8.pack "Content-Type", B8.pack "text/plain")]
30index :: ResponseBody -> IO ()
31index rb = sendFile rb "index.html"
33postBody :: IO (Maybe B.ByteString) -> ResponseBody -> IO ()
38 Just bs -> sendByteString res bs >> postBody req res
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list