@@ -44,7 +44,7 @@ data App = App
45-- Each handler runs in the 'ExceptT ServantErr IO' monad.
45-- Each handler runs in the 'ExceptT ServantErr IO' monad.
46server :: Server API (Handler App App)
46server :: Server API (Handler App App)
47−server = return () :<|> return 100 :<|> sayhi :<|> dbl :<|> serveDirectory "static"
47+server = return () :<|> return 100 :<|> sayhi :<|> dbl :<|> multi :<|> serveDirectory "static"
48 where sayhi nm greetings withGusto = case nm of
48 where sayhi nm greetings withGusto = case nm of
49 Nothing -> return ("Sorry, who are you?" :: String)
49 Nothing -> return ("Sorry, who are you?" :: String)
50 Just n -> do
50 Just n -> do
@@ -56,6 +56,7 @@ server = return () :<|> return 100 :<|> sayhi :<|> dbl :<|> serveDirectory "stat
56 ++ ", and " ++ L.last greetings ++ ", "
56 ++ ", and " ++ L.last greetings ++ ", "
57 return . modifier $ greetPart ++ n
57 return . modifier $ greetPart ++ n
58 dbl x = return $ x * 2
58 dbl x = return $ x * 2
59+ multi = return . bool "Box unchecked" "Box Checked"
60-- Turn the server into a WAI app. 'serve' is provided by servant,
61-- Turn the server into a WAI app. 'serve' is provided by servant,
61-- more precisely by the Servant.Server module.
62-- more precisely by the Servant.Server module.