on master help sign in
Fix pong.hs
commite7a3a6ab9b1cf31b8a05cf42d5c715040bd518d5 authorMichael Snoyman <michael@snoyman.com> dateWed 1 Jan 2014, 21:49 (13 years ago) parent0c3b855
1 file changed+9−9
warp-tls/pong.hs+9−9
warp-tls/pong.hs+9−9
@@ -12,8 +12,8 @@ import Network.HTTP.Conduit
1212
1313main = do
1414 putStrLn "https://localhost:3009/"
15− manager <- newManager def
16− runTLS (tlsSettings "config/tls-cert" "config/tls-key") defaultSettings { settingsPort = 3009 } app
15+ --manager <- newManager def
16+ runTLS (tlsSettings "certificate.pem" "key.pem") defaultSettings { settingsPort = 3009 } app
1717
1818app req = return $
1919 case rawPathInfo req of
@@ -25,33 +25,33 @@ app req = return $
2525 "/source/nolen" -> sourceNoLen
2626 x -> index x
2727
28−builderWithLen = ResponseBuilder
28+builderWithLen = responseBuilder
2929 status200
3030 [ ("Content-Type", "text/plain")
3131 , ("Content-Length", "4")
3232 ]
3333 $ copyByteString "PONG"
3434
35−builderNoLen = ResponseBuilder
35+builderNoLen = responseBuilder
3636 status200
3737 [ ("Content-Type", "text/plain")
3838 ]
3939 $ copyByteString "PONG"
4040
41−sourceWithLen = ResponseSource
41+sourceWithLen = responseSource
4242 status200
4343 [ ("Content-Type", "text/plain")
4444 , ("Content-Length", "4")
4545 ]
4646 $ CL.sourceList [C.Chunk $ copyByteString "PONG"]
4747
48−sourceNoLen = ResponseSource
48+sourceNoLen = responseSource
4949 status200
5050 [ ("Content-Type", "text/plain")
5151 ]
5252 $ CL.sourceList [C.Chunk $ copyByteString "PONG"]
5353
54−fileWithLen = ResponseFile
54+fileWithLen = responseFile
5555 status200
5656 [ ("Content-Type", "text/plain")
5757 , ("Content-Length", "4")
@@ -59,14 +59,14 @@ fileWithLen = ResponseFile
5959 "pong.txt"
6060 Nothing
6161
62−fileNoLen = ResponseFile
62+fileNoLen = responseFile
6363 status200
6464 [ ("Content-Type", "text/plain")
6565 ]
6666 "pong.txt"
6767 Nothing
6868
69−index p = ResponseBuilder status200 [("Content-Type", "text/html")] $ mconcat $ map copyByteString
69+index p = responseBuilder status200 [("Content-Type", "text/html")] $ mconcat $ map copyByteString
7070 [ "<p><a href='/builder/withlen'>builder withlen</a></p>\n"
7171 , "<p><a href='/builder/nolen'>builder nolen</a></p>\n"
7272 , "<p><a href='/file/withlen'>file withlen</a></p>\n"