Index: [Article Count Order] [Thread]

Date: Fri, 19 Nov 2004 14:45:33 -0500 (EST)
From: "Lloyd Zusman" <ljz@asfast.com>
Subject: [webricken:129] Invoking a FileHandler from a mount_proc?
To: webricken@notwork.org
Message-Id: <32734.167.203.48.180.1100893533.squirrel@167.203.48.180>
X-Mail-Count: 00129

I have a mount_proc that handles a range of URL's.  After doing
some initial processing within the mount_proc, I want to pass a
subset of these URL's to a FileHandler; for the rest of the URL's
I just want to output a message.

A simplified version of what I want to do looks like this:

  my_mount_proc = lambda {
    |req, res|
    # First, do some initial processing for all URL's that are
    # passed in to this proc.  But then ...
    if req.path =~ /some-sort-of-special-pattern/ then
      ### send the request to a FileHandler
    else
      res.body = 'No FileHandler -- just this simple message'
      res['Content-type'] = 'text/plain'
    end
  }

What do I put between the 'if' and the 'else' in order to send the
matching requests to a FileHandler?

Thanks in advance.


-- 
 Lloyd Zusman
 ljz@asfast.com
 God bless you.