Skip to content

Instantly share code, notes, and snippets.

@lancepantz
Created July 21, 2010 19:55
Show Gist options
  • Save lancepantz/485024 to your computer and use it in GitHub Desktop.
Save lancepantz/485024 to your computer and use it in GitHub Desktop.
(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