Added a lot of a dummy website, to guide actual building of the app.
This commit is contained in:
parent
fe7028de8e
commit
16b45a1b6e
12 changed files with 580 additions and 0 deletions
47
src/clj/youyesyet/routes/services.clj
Normal file
47
src/clj/youyesyet/routes/services.clj
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
(ns youyesyet.routes.services
|
||||
(:require [clj-http.client :as client]
|
||||
[ring.util.http-response :refer :all]
|
||||
[compojure.api.sweet :refer :all]
|
||||
[schema.core :as s]))
|
||||
|
||||
(defapi service-routes
|
||||
{:swagger {:ui "/swagger-ui"
|
||||
:spec "/swagger.json"
|
||||
:data {:info {:version "1.0.0"
|
||||
:title "Sample API"
|
||||
:description "Sample Services"}}}}
|
||||
|
||||
(context "/api" []
|
||||
:tags ["thingie"]
|
||||
|
||||
(GET "/electors/:address-id" []
|
||||
|
||||
(GET "/plus" []
|
||||
:return Long
|
||||
:query-params [x :- Long, {y :- Long 1}]
|
||||
:summary "x+y with query-parameters. y defaults to 1."
|
||||
(ok (+ x y)))
|
||||
|
||||
(POST "/minus" []
|
||||
:return Long
|
||||
:body-params [x :- Long, y :- Long]
|
||||
:summary "x-y with body-parameters."
|
||||
(ok (- x y)))
|
||||
|
||||
(GET "/times/:x/:y" []
|
||||
:return Long
|
||||
:path-params [x :- Long, y :- Long]
|
||||
:summary "x*y with path-parameters"
|
||||
(ok (* x y)))
|
||||
|
||||
(POST "/divide" []
|
||||
:return Double
|
||||
:form-params [x :- Long, y :- Long]
|
||||
:summary "x/y with form-parameters"
|
||||
(ok (/ x y)))
|
||||
|
||||
(GET "/power" []
|
||||
:return Long
|
||||
:header-params [x :- Long, y :- Long]
|
||||
:summary "x^y with header-parameters"
|
||||
(ok (long (Math/pow x y))))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue