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:

 (lambda (path handler)
   (when (string-prefix? "/foo" path)
         ((debug-file "/tmp/foo-debug")
          (enable-ajax #t))

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