(index ("uri-match/spiffy" 0) ("default-response-headers" 1349) ("redirect-to" 1662))
(def (sig (procedure "(uri-match/spiffy routes)" (id uri-match/spiffy))) (p "Returns a procedure suitable for use as a spiffy handler. It will match against the HTTP method and URI of the " (tt "current-request") " parameter. The " (tt "routes") " argument is passed directly to " (tt "make-uri-matcher") " of " (int-link "uri-match") " and thus must be in the format described there. If a route matches, its handler is called with " (tt "current-response") " modified to include the headers given in the " (tt "default-response-headers") " parameter. If no route matches, the handler will call the " (tt "continue") " procedure passed by spiffy.") (p (int-link "uri-match/spiffy") " integrates with spiffy via the vhost-map hooks.") (highlight scheme "(vhost-map `((\".*\" . ,(lambda (continue) (continue)))))\n(vhost-map `((\".*\" . ,(lambda (c) (send-status 200 \"TEST\")))))\n(vhost-map `((\".*\" . ,(uri-match/spiffy\n\t\t\t`(((/ \"\")\n\t\t\t   (GET ,(lambda (c) (c)))))))))\n(vhost-map `((\".*\" . ,(uri-match/spiffy\n\t\t\t`(((/ \"\")\n\t\t\t   (GET ,(lambda (c) (send-status 200 \"TEST\")))))))))\n(vhost-map `((\".*\" . ,(uri-match/spiffy\n\t\t\t`(((/ \"\")\n\t\t\t   (GET ,(lambda (c)\n\t\t\t\t   (send-response\n\t\t\t\t     status: 'ok\n\t\t\t\t     body: \"Hello World!\"\n\t\t\t\t     headers: '((content-type text/html)))))))))))"))
(def (sig (parameter "(default-response-headers [headers])" (id default-response-headers))) (p "A list of headers to be used for all requests handled by handlers created through " (tt "uri-match/spiffy") ". Defaults to") (pre " '((content-type #(text/html ((charset . \"utf-8\"))))\n   (accept-charset utf-8))"))
(def (sig (procedure "(redirect-to path #!key (code 302) (headers '()))" (id redirect-to))) (p "Convenience procedure for sending redirects relative to the current " (tt "server-root-uri") "."))
