mirror of
https://github.com/metosin/reitit.git
synced 2025-12-20 09:31:11 +00:00
11 lines
358 B
Clojure
11 lines
358 B
Clojure
|
|
(ns example.plain)
|
||
|
|
|
||
|
|
(def routes
|
||
|
|
["/plain"
|
||
|
|
["/plus" {:get (fn [{{:strs [x y]} :query-params :as req}]
|
||
|
|
{:status 200
|
||
|
|
:body {:total (+ (Long/parseLong x) (Long/parseLong y))}})
|
||
|
|
:post (fn [{{:keys [x y]} :body-params}]
|
||
|
|
{:status 200
|
||
|
|
:body {:total (+ x y)}})}]])
|