aboutsummaryrefslogtreecommitdiff
path: root/src/cashflow/routes.clj
diff options
context:
space:
mode:
authorTim <contact@bytim.eu>2026-02-22 15:25:50 +0100
committerTim <contact@bytim.eu>2026-02-22 15:25:50 +0100
commitf279e20468fb5323c33cbf43346c35ddef7f96e0 (patch)
treec488ee2791296917367f704524fa8e41a0b518ea /src/cashflow/routes.clj
Initial commit
Diffstat (limited to 'src/cashflow/routes.clj')
-rw-r--r--src/cashflow/routes.clj28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/cashflow/routes.clj b/src/cashflow/routes.clj
new file mode 100644
index 0000000..8c2dbc8
--- /dev/null
+++ b/src/cashflow/routes.clj
@@ -0,0 +1,28 @@
+(ns cashflow.routes
+ (:require [reitit.ring :as rring]
+ [ring.util.response :as ruresp]
+ [ring.middleware.params :as rmparams]
+ [cashflow.frontend.home :as cfhome]
+ [cashflow.frontend.transactions.one-time :as cftone-time]
+ [cashflow.frontend.transactions.recurring :as cftrecurring]))
+
+(def routes [["/static/*" (rring/create-resource-handler)]
+
+ ["/" {:get {:handler (fn [& _] (ruresp/redirect "/transactions/one-time/" 308))}}]
+
+ ["/transactions"
+ ["/one-time"
+ ["/" {:get {:handler cftone-time/handle-get}
+ :post {:handler cftone-time/handle-post}}]
+ ["/{year}/{month}/" {:get {:handler cftone-time/handle-get}}]
+ ["/{id}/" {:delete {:handler cftone-time/handle-delete}}]]
+ ["/recurring"
+ ["/" {:get {:handler cftrecurring/handle-get}
+ :post {:handler cftrecurring/handle-post}}]
+ ["/{id}/" {:delete {:handler cftrecurring/handle-delete}}]]]])
+
+(def ring-handler (-> routes
+ (rring/router {:middleware []})
+ rring/ring-handler
+ rmparams/wrap-params))
+