Last active
October 2, 2019 14:48
-
-
Save rlander/a0375b06f2b92b3298c67c43352776a5 to your computer and use it in GitHub Desktop.
Revisions
-
rlander revised this gist
Oct 2, 2019 . 3 changed files with 16 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ (ns myapi.interceptors) (def user-auth {:before (fn [context] (update-in context :password h/encrypt-password)) :after (fn [context] (dissoc context [:password]))}) (def interceptors [user-auth]) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ (ns myapi.routes) (def routes (start-server ... (mount ::myapi.my-service ::myapi.interceptors))) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ (ns myapi.services) (defn fetch [id params] (db/select-one id params)) -
rlander created this gist
Oct 2, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ (defn fetch [id params] (db/select-one id params)) (defn fetch* [params] (db/select params)) (defn create! [data params] (db/insert! data params))