aboutsummaryrefslogtreecommitdiff
path: root/src/server/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Main.hs')
-rw-r--r--src/server/Main.hs39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/server/Main.hs b/src/server/Main.hs
index 1a151fc..8956fa4 100644
--- a/src/server/Main.hs
+++ b/src/server/Main.hs
@@ -33,46 +33,43 @@ main = do
middleware $
staticPolicy (noDots >-> addBase "public")
- get "/" $
- getIndexAction
+ get "/" getIndex
+ post "/signOut" signOut
+
+ -- SignIn
post "/signIn" $ do
login <- param "login" :: ActionM Text
- signInAction config login
+ signIn config login
get "/validateSignIn" $ do
token <- param "token" :: ActionM Text
- validateSignInAction config token
+ validateSignIn config token
- post "/signOut" $
- signOutAction
+ -- Users
- get "/whoAmI" $
- whoAmIAction
+ get "/users" getUsers
+ get "/whoAmI" whoAmI
+ get "/income" getIncome
- get "/users" $ do
- getUsersAction
+ -- Payments
get "/payments" $ do
- page <- param "page" :: ActionM Int
+ page <- param "page" :: ActionM Int
perPage <- param "perPage" :: ActionM Int
- getPaymentsAction page perPage
+ getPayments page perPage
- get "/monthlyPayments" $ do
- getMonthlyPaymentsAction
+ get "/monthlyPayments" getMonthlyPayments
post "/payment/add" $ do
name <- param "name" :: ActionM Text
cost <- param "cost" :: ActionM Int
frequency <- param "frequency" :: ActionM Frequency
- createPaymentAction name cost frequency
+ createPayment name cost frequency
post "/payment/delete" $ do
paymentId <- param "id" :: ActionM Text
- deletePaymentAction paymentId
-
- get "/payments/total" $ do
- getTotalPaymentsAction
+ deletePayment paymentId
- get "/payments/count" $ do
- getPaymentsCountAction
+ get "/payments/total" getTotalPayments
+ get "/payments/count" getPaymentsCount