adapt examples to baseurl fix
This commit is contained in:
parent
a403eee488
commit
e0f4ed6426
1 changed files with 4 additions and 7 deletions
|
@ -12,27 +12,24 @@ import GS3
|
||||||
|
|
||||||
position :: Int -- ^ value for "x"
|
position :: Int -- ^ value for "x"
|
||||||
-> Int -- ^ value for "y"
|
-> Int -- ^ value for "y"
|
||||||
-> BaseUrl
|
|
||||||
-> EitherT ServantError IO Position
|
-> EitherT ServantError IO Position
|
||||||
|
|
||||||
hello :: Maybe String -- ^ an optional value for "name"
|
hello :: Maybe String -- ^ an optional value for "name"
|
||||||
-> BaseUrl
|
|
||||||
-> EitherT ServantError IO HelloMessage
|
-> EitherT ServantError IO HelloMessage
|
||||||
|
|
||||||
marketing :: ClientInfo -- ^ value for the request body
|
marketing :: ClientInfo -- ^ value for the request body
|
||||||
-> BaseUrl
|
|
||||||
-> EitherT ServantError IO Email
|
-> EitherT ServantError IO Email
|
||||||
|
|
||||||
position :<|> hello :<|> marketing = client api
|
position :<|> hello :<|> marketing = client api baseUrl
|
||||||
|
|
||||||
baseUrl :: BaseUrl
|
baseUrl :: BaseUrl
|
||||||
baseUrl = BaseUrl Http "localhost" 8081
|
baseUrl = BaseUrl Http "localhost" 8081
|
||||||
|
|
||||||
queries :: EitherT ServantError IO (Position, HelloMessage, Email)
|
queries :: EitherT ServantError IO (Position, HelloMessage, Email)
|
||||||
queries = do
|
queries = do
|
||||||
pos <- position 10 10 baseUrl
|
pos <- position 10 10
|
||||||
msg <- hello (Just "servant") baseUrl
|
msg <- hello (Just "servant")
|
||||||
em <- marketing (ClientInfo "Alp" "alp@foo.com" 26 ["haskell", "mathematics"]) baseUrl
|
em <- marketing (ClientInfo "Alp" "alp@foo.com" 26 ["haskell", "mathematics"])
|
||||||
return (pos, msg, em)
|
return (pos, msg, em)
|
||||||
|
|
||||||
run :: IO ()
|
run :: IO ()
|
||||||
|
|
Loading…
Reference in a new issue