reitit/examples/ring-example/src/example/plain.clj
2018-08-27 09:12:09 +03:00

10 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)}})}]])