Created
July 21, 2010 19:55
-
-
Save lancepantz/485024 to your computer and use it in GitHub Desktop.
This file contains 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 characters
(PUT "/:focus/:action" | |
{{type "focus" action "action"} :route-params | |
body :body | |
uri :uri | |
query-string :query-string | |
opts :query-params | |
:as request} | |
(let [nspace (symbol (str 'actions. type)) | |
action (parse-action action) | |
opts (assoc opts :uri (str uri "?" query-string))] | |
(require nspace) | |
(json/generate-string | |
((ns-resolve nspace action) body (parse-opts opts)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment