From b5f29a2f7a4e970ee07d3e57eaba189de05e3bb8 Mon Sep 17 00:00:00 2001 From: Connor Prussin Date: Thu, 13 Jul 2017 23:43:20 -0700 Subject: [PATCH] Fix quickstart example (#25) --- Readme.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Readme.md b/Readme.md index 826cf93..5cca301 100644 --- a/Readme.md +++ b/Readme.md @@ -26,22 +26,17 @@ bower install --save purescript-httpure ```purescript module Main where -import Prelude (map, ($)) +import Prelude (pure, ($)) import Control.Monad.Eff.Console as Console +import Data.StrMap as StrMap import HTTPure as HTTPure -main :: HTTPure.HTTPureM (console :: Console.CONSOLE) +main :: HTTPure.ServerM (console :: Console.CONSOLE) main = do - HTTPure.serve 8080 routes $ Console.log "Server now up on port 8080" + HTTPure.serve 8080 router $ Console.log "Server now up on port 8080" where - routes = - [ HTTPure.Get "/" - { status: \_ -> 200 - , headers: \_ -> [] - , body: \_ -> "hello world!" - } - ] + router _ = pure $ HTTPure.OK StrMap.empty "hello world!" ``` ## Documentation