summaryrefslogtreecommitdiff
path: root/Hero/Host.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Hero/Host.hs')
-rw-r--r--Hero/Host.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Hero/Host.hs b/Hero/Host.hs
index fd010af..5496f27 100644
--- a/Hero/Host.hs
+++ b/Hero/Host.hs
@@ -106,7 +106,7 @@ move _ = bracket startup shutdown run
run (cfg, app, _) = Warp.run (heroPort cfg) app
prn = IO.hPutStrLn IO.stderr
startup =
- Envy.decodeEnv >>= \case
+ Envy.decodeEnv +> \case
Left e -> Exit.die e
Right cfg ->
do
@@ -139,7 +139,7 @@ move _ = bracket startup shutdown run
:<|> wrapAuth appHostHandlers
-- fall through to 404
:<|> Tagged handle404
- return
+ pure
( cfg,
serveWithContext
proxy
@@ -150,11 +150,11 @@ move _ = bracket startup shutdown run
shutdown :: App -> IO ()
shutdown (_, _, keep) = do
Keep.close keep
- return ()
+ pure ()
upsertKey :: FilePath -> IO Crypto.JWK
upsertKey fp =
- Directory.doesFileExist fp >>= \exists ->
+ Directory.doesFileExist fp +> \exists ->
if exists
then Auth.readKey fp
else Auth.writeKey fp >> Auth.readKey fp
@@ -229,7 +229,7 @@ type CssRoute = "css" :> "main.css" :> Get '[CSS] Text
cssHandlers :: Server CssRoute
cssHandlers =
- return <. Lazy.toStrict <. Clay.render <| Typography.main <> Look.main
+ pure <. Lazy.toStrict <. Clay.render <| Typography.main <> Look.main
type AuthRoute =
"auth"
@@ -274,7 +274,7 @@ authHandler cookieSettings jwtSettings loginForm =
mApplyCookies <- liftIO <| Auth.acceptLogin cookieSettings jwtSettings usr
case mApplyCookies of
Nothing -> throwError err401
- Just applyCookies -> return <| applyCookies usr
+ Just applyCookies -> pure <| applyCookies usr
-- | See also 'server' above
type AllRoutes auths =