[Mongrel] need help writing a plugin

Zed A. Shaw zedshaw at zedshaw.com
Mon Mar 12 10:34:24 EDT 2007

On Mon, 12 Mar 2007 13:47:27 +0100
Jeroen Houben <jeroen at supercool.nl> wrote:

> Hi,
> I'm halfway developing a tiny plugin that allows people to scrub flash 
> video files. I've got my plugin setup to monitor a directory /movies.
> Whenever a .flv file is requested within that directory, some stuff 
> should happen, if not, the request should be processed as usual. I don't 
> know how to do the latter..

Handlers are put in a chain and you can load them in front or back
(default is in back).  In your case, you want your handler to either do
the processing and then set the response to finished (see HttpResponse
docs), or simply ignore the request and let it continue.  Then, you'll
just register the handler on "/" but give the :in_front => true option.

Let me know if you need more than that.

Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu
http://www.awprofessional.com/title/0321483502 -- The Mongrel Book

More information about the Mongrel-users mailing list