NAME
Devel::Pillbug - Tiny HTML::Mason server
SYNOPSIS
Install Devel::Pillbug:
> perl -MCPAN -e 'install Devel::Pillbug';
Start Devel::Pillbug:
> pillbug;
All arguments are optional:
> pillbug -host example.com -port 8080 -docroot /tmp/foo
Do it in Perl:
use Devel::Pillbug;
my $port = 8000; # Optional argument, default is 8080
my $server = Devel::Pillbug->new($port);
#
# Optional: Use methods from HTTP::Server::Simple
#
# $server->host("example.com");
#
# Optional: Override the document root
#
# $server->docroot("/tmp/foo");
$server->run;
DESCRIPTION
Devel::Pillbug is a tiny embedded HTML::Mason server, based on HTTP::Server::Simple::Mason. It is designed for zero configuration and easy install from CPAN.
The "public_html" or "Sites" directory of the user who launched the process will be used for the document root. Files ending in "html" are treated as Mason components.
METHODS
See HTTP::Server::Simple and HTTP::Server::Simple::Mason for inherited methods.
CLASS METHODS
$class->net_server($newServerType);
Returns the currently active Net::Server subclass.
Sets the server type to the specified Net::Server subclass, if one is supplied as an argument.
Default value is Net::Server::PreFork.
$class->handler_class($newHandlerClass);
Returns the currently active HTML::Mason::Request subclass.
Sets the server type to the specified HTML::Mason::Request subclass, if supplied as an argument.
Default value is Devel::Pillbug::MasonHandler.
INSTANCE METHODS
$self->docroot($docroot);
Returns the currently active docroot.
The server will set its docroot to the received absolute path, if supplied as an argument.
$self->index_name($name);
Returns currently used index name, without extension (default is "index").
Sets this to the received name, if supplied as an argument.
$self->comp_ext($extension);
Sets the file extension used for Mason components (default is "html")
$self->allow_index($bool);
Returns the current allowed state for directory indexes.
Sets this to the received state, if supplied as an argument.
0 = Off, 1 = On
CONFIGURATION AND ENVIRONMENT
The document root must exist and be readable, and Devel::Pillbug must be able to bind to its listen port (default 8080).
VERSION
This document is for version .005 of Devel::Pillbug.
AUTHOR
Alex Ayars <pause@nodekit.org>
COPYRIGHT AND LICENSE
Copyright (C) 2010, Alex Ayars <pause@nodekit.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0 or later. See: http://dev.perl.org/licenses/
SEE ALSO
File::HomeDir, File::Type, Net::Server::PreFork.
This module extends HTTP::Server::Simple::Mason.