1{-# LANGUAGE Rank2Types #-}
3import Network.Wai.Handler.SimpleServer
4import qualified Data.ByteString.Char8 as B8
5import qualified Network.Wai.Source as Source
8main = putStrLn "http://localhost:3000/" >> run 3000 app
11app req = case B8.unpack $ pathInfo req of
12 "/post/" -> postResponse $ Source.toEnumerator $ requestBody req
15indexResponse :: IO Response
16indexResponse = return Response
18 , responseHeaders = [(ContentType, B8.pack "text/html")]
19 , responseBody = index
22postResponse :: Enumerator -> IO Response
23postResponse rb = return Response
25 , responseHeaders = [(ContentType, B8.pack "text/plain")]
26 , responseBody = Right rb
29index :: Either FilePath a
30index = Left "index.html"
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