Skip to content

Instantly share code, notes, and snippets.

@ordnungswidrig
Created December 15, 2010 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ordnungswidrig/847630a9e5cf25d03421 to your computer and use it in GitHub Desktop.
Save ordnungswidrig/847630a9e5cf25d03421 to your computer and use it in GitHub Desktop.
Dynamically configurable routing to handlers
;; name is like foo.bar.baz/myhandler
(defn set-handler-from-name! [name]
(let [f (ns-resolve *ns* (symbol name))]
(dosync (set! @handler f))
(defn serlvet [req]
(@handler req))
(defservice servlet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment