Skip to content

Instantly share code, notes, and snippets.

@ordnungswidrig
Created February 2, 2010 20:25
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/292997 to your computer and use it in GitHub Desktop.
Save ordnungswidrig/292997 to your computer and use it in GitHub Desktop.
(def hello-resource
(resource
:content-types-provided { "text/html" :to_html ; lookup
"text/markdown" :please_make_markdown ;double lookup
"text/plain" "Plaintext" ; literal
"x/y" (fn [rmap req status] (str "Status " status)) ; function
"foo/bar" [500 "Experimental Server Error"] } ;
:to_html (html [:body [:h1 "This is HTML!"]]
:please_make_markdown :please_please_markdown
:please_please_markdown "Yes, this is markdown"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment