reitit/examples/ring-example/src/example/plain.clj

11 lines
358 B
Clojure
Raw Normal View History

2018-08-27 06:12:09 +00:00
(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)}})}]])