PureScript 0.12 support (#89)

- Upgrade all dependencies
- Use Effect instead of Eff
- Use Foreign.Object instead of StrMap
- Use Effect.Ref instead of Control.Monad.ST
- Drop SecureServerM, it's the same as ServerM now
This commit is contained in:
Petri Lehtinen
2018-07-09 02:16:48 +03:00
committed by Connor Prussin
parent 48e37c4672
commit 8badd62b3e
31 changed files with 362 additions and 450 deletions

View File

@@ -2,7 +2,7 @@ module Examples.QueryParameters.Main where
import Prelude
import Control.Monad.Eff.Console as Console
import Effect.Console as Console
import HTTPure as HTTPure
import HTTPure ((!@), (!?))
@@ -15,14 +15,14 @@ portS :: String
portS = show port
-- | Specify the routes
router :: forall e. HTTPure.Request -> HTTPure.ResponseM e
router :: HTTPure.Request -> HTTPure.ResponseM
router { query }
| query !? "foo" = HTTPure.ok "foo"
| query !@ "bar" == "test" = HTTPure.ok "bar"
| otherwise = HTTPure.ok $ query !@ "baz"
-- | Boot up the server
main :: forall e. HTTPure.ServerM (console :: Console.CONSOLE | e)
main :: HTTPure.ServerM
main = HTTPure.serve port router do
Console.log $ " ┌────────────────────────────────────────┐"
Console.log $ " │ Server now up on port " <> portS <> " │"