aboutsummaryrefslogtreecommitdiff
path: root/src/server/Main.hs
diff options
context:
space:
mode:
authorJoris2016-03-31 00:06:50 +0200
committerJoris2016-03-31 00:13:25 +0200
commitc95e19407d492a0d4e9e14e320520fe29ce379e5 (patch)
treeca6a14ad1396af6a4bc36e17ce89278d5dbea0a0 /src/server/Main.hs
parentc542551ad043260e6a4a6569b4af5c748f7b6001 (diff)
downloadbudget-c95e19407d492a0d4e9e14e320520fe29ce379e5.tar.gz
budget-c95e19407d492a0d4e9e14e320520fe29ce379e5.tar.bz2
budget-c95e19407d492a0d4e9e14e320520fe29ce379e5.zip
Add init data in html page
Diffstat (limited to 'src/server/Main.hs')
-rw-r--r--src/server/Main.hs15
1 files changed, 7 insertions, 8 deletions
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