chickadee » awful » add-request-handler-hook!

add-request-handler-hook! hook-id procprocedure

Adds a hook identified by id (can be used to remove the hook if necessary). proc is a two-argument procedure which receives the requested path and its handler.

Here's a simple usage example:

(add-request-handler-hook!
 'foo
 (lambda (path handler)
   (when (string-prefix? "/foo" path)
     (parameterize
         ((debug-file "/tmp/foo-debug")
          (enable-ajax #t))
       (handler))))

By using request handlers, you can parameterize parameter values in a way that they don't affect other applications.