added routing to the API

This commit is contained in:
Christian Mueller
2014-01-12 11:59:23 +01:00
parent 5f7d9ab251
commit 89031c2f08
3 changed files with 24 additions and 3 deletions
+14
View File
@@ -184,3 +184,17 @@
(defpage "/api" args
(let [title (get-message :api-registration)]
(layout title [:article.markdown (slurp "API.md")])))
(defpage [:get "/api/note"] {:keys [version noteID]}
(generate-string (api/get-note noteID)))
(defpage [:post "/api/note"] {:keys [version note pid signature password]}
(generate-string (api/post-note note pid signature password)))
(defpage [:put "/api/note"] {:keys [version noteID note pid signature password]}
(generate-string (api/update-note noteID note pid signature password)))