From c95e19407d492a0d4e9e14e320520fe29ce379e5 Mon Sep 17 00:00:00 2001 From: Joris Date: Thu, 31 Mar 2016 00:06:50 +0200 Subject: Add init data in html page --- src/server/Main.hs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/server/Main.hs') diff --git a/src/server/Main.hs b/src/server/Main.hs index 9734781..387f782 100644 --- a/src/server/Main.hs +++ b/src/server/Main.hs @@ -3,6 +3,7 @@ import Web.Scotty import Network.Wai.Middleware.Static +import Network.HTTP.Types.Status (ok200) import Control.Concurrent (forkIO) @@ -41,14 +42,12 @@ main = do notFound $ ( do signInToken <- param "signInToken" :: ActionM Text - successOrError <- validateSignIn conf signInToken - case successOrError of - Left errorKey -> - (getIndex conf (Just errorKey)) - Right _ -> - (getIndex conf Nothing) - ) `rescue` (\_ -> getIndex conf Nothing) - + status ok200 + getIndex conf (Just signInToken) + ) `rescue` (\_ -> do + status ok200 + getIndex conf Nothing + ) api :: Conf -> ScottyM () api conf = do -- cgit v1.2.3