Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for [[/eggref/5/spiffy-uri-match|the CHICKEN 5 version of this egg]], if it exists. If it does not exist, there may be equivalent functionality provided by another egg; have a look at the [[https://wiki.call-cc.org/chicken-projects/egg-index-5.html|egg index]]. Otherwise, please consider porting this egg to the current version of CHICKEN. [[tags: egg]] == spiffy-uri-match [[toc:]] === Description A library providing integration of [[uri-match]] for [[spiffy]]. === Author Moritz Heidkamp === Requirements Requires the [[uri-match]], [[spiffy]], [[uri-common]] and [[intarweb]] extensions. === Documentation <procedure>(uri-match/spiffy routes)</procedure> Returns a procedure suitable for use as a spiffy handler. It will match against the HTTP method and URI of the {{current-request}} parameter. The {{routes}} argument is passed directly to {{make-uri-matcher}} of [[uri-match]] and thus must be in the format described there. If a route matches, its handler is called with {{current-response}} modified to include the headers given in the {{default-response-headers}} parameter. If no route matches, the handler will call the {{continue}} procedure passed by spiffy. [[uri-match/spiffy]] integrates with spiffy via the vhost-map hooks. <enscript highlight="scheme"> (vhost-map `((".*" . ,(lambda (continue) (continue))))) (vhost-map `((".*" . ,(lambda (c) (send-status 200 "TEST"))))) (vhost-map `((".*" . ,(uri-match/spiffy `(((/ "") (GET ,(lambda (c) (c))))))))) (vhost-map `((".*" . ,(uri-match/spiffy `(((/ "") (GET ,(lambda (c) (send-status 200 "TEST"))))))))) (vhost-map `((".*" . ,(uri-match/spiffy `(((/ "") (GET ,(lambda (c) (send-response status: 'ok body: "Hello World!" headers: '((content-type text/html))))))))))) </enscript> <parameter>(default-response-headers [headers])</parameter> A list of headers to be used for all requests handled by handlers created through {{uri-match/spiffy}}. Defaults to '((content-type #(text/html ((charset . "utf-8")))) (accept-charset utf-8)) <procedure>(redirect-to path #!key (code 302) (headers '()))</procedure> Convenience procedure for sending redirects relative to the current {{server-root-uri}}.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you multiply 3 by 7?