|
NAMEPOE::Component::Server::HTTPServer::StaticHandler - serve static filesSYNOPSISuse POE::Component::Server::HTTPServer; my $server = POE::Component::Server::HTTPServer->new(); $server->handlers([ '/static' => new_handler( 'StaticHandler', $static_root ), '/static2' => new_handler( 'StaticHandler', $static_root, auto_index => 1, ), ]); DESCRIPTIONStaticHandler provides a request handler which serves static filesystem resources relative to a given root. It may also be subclassed to handle interpreted requests based on filesystem resources such as parsed or templated pages.StaticHandler expects to be created with at least one argument. The first argument should be the location of the document root. Requests relative to the prefix associated with this handler will be resolved to file names relative to this directory. If found, the contents of the file will be returned as the response. StaticHandler may also be given the following arguments when created:
Subclassing StaticHandlerWhen handling requests, StaticHandler invokes two methods which may be overridden to modify the default behavior. One of the following is invoked when StaticHandler resolves a request to a given file or directory:
SEE ALSOPOE::Component::Server::HTTPServer, POE::Component::Server::HTTPServer::TemplateHandlerAUTHORGreg Fast <gdf@speakeasy.net>COPYRIGHTCopyright 2003 Greg Fast.This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |