Skip to content

Instantly share code, notes, and snippets.

@PasiHeikkinen
Created September 7, 2011 17:22
Show Gist options
  • Select an option

  • Save PasiHeikkinen/1201170 to your computer and use it in GitHub Desktop.

Select an option

Save PasiHeikkinen/1201170 to your computer and use it in GitHub Desktop.
(defmacro my-route
[method path handler]
`(~method ~path {cookies# :cookies params# :params} (~handler cookies# params#)))
(defmacro def-my-routes
[name & body]
(let [stuff (map (fn [route] `(my-route ~@route)) body)]
`(defroutes ~name
~@stuff)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment