diff options
author | Joris Guyonvarch | 2015-07-19 00:54:37 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-07-19 00:54:37 +0200 |
commit | e4eefaa5b418780e6fb63e929f826b927bbeac68 (patch) | |
tree | ec699112790f31d33195fd116d10d30e93a493da /src/server/Main.hs | |
parent | a6727f104f808e533052f2bd83bc89cd6bfa0522 (diff) |
Authorizing only existing users
Diffstat (limited to 'src/server/Main.hs')
-rw-r--r-- | src/server/Main.hs | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/server/Main.hs b/src/server/Main.hs index 8d5a625..4461945 100644 --- a/src/server/Main.hs +++ b/src/server/Main.hs @@ -14,10 +14,24 @@ main :: IO () main = do runMigrations scotty 3000 $ do - middleware $ staticPolicy (noDots >-> addBase "public") - get "/" getIndexAction + + middleware $ + staticPolicy (noDots >-> addBase "public") + + get "/" $ + getIndexAction + + post "/signIn" $ do + login <- param "login" :: ActionM Text + signIn login + + post "/signOut" $ + signOut + + get "/payments" $ + getPaymentsAction + get "/users" getUsersAction - get "/payments" getPaymentsAction post "/user/add" $ do email <- param "email" :: ActionM Text name <- param "name" :: ActionM Text @@ -30,13 +44,3 @@ main = do name <- param "name" :: ActionM Text cost <- param "cost" :: ActionM Int insertPaymentAction email name cost - - post "/signIn" $ do - login <- param "login" :: ActionM Text - signIn login - - post "/checkConnection" $ - checkConnection - - post "/signOut" $ - signOut |