Apache::Hendrix - Provides a route-to-sub based web framework
use Apache::Hendrix;
my $base = '/web_path/base'
base($base); # Base for routes form here below
template_variable->{base} = $base; # Base for templates "base" template_config->{PRE_PROCESS} = 'header.tt'; template_config->{POST_PROCESS} = 'footer.tt'; template_config->{INCLUDE_PATH} = '/my/path/to/templates/';
get '/' => sub { my ( $params, $apache_request, $this_sub_reference ) = @_; my @articles = get_articles ..... ; return template( 'index.tt', { articles => \@articles, page => 'news', ... } ); };
get '/thing/:param' => sub { ... }
post '/post/:param' => sub { ... }
get qr/some.*regexp/ => sub { ... }
Provides simple methods to simplify web development. Routes may be specified as "get", "post", "head", or "put" currently. Raw perl structures returned will be converted into JSON.
base - sets the base url for calls from this point in the code forward
'get', 'post', 'post', 'head', 'any [optional array]' => sub - defines a route
template - call a template to be created
template_config - configure the template
template_variable - Set a variable to be used in a template
To install Apache::Hendrix, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Apache::Hendrix
CPAN shell
perl -MCPAN -e shell install Apache::Hendrix
For more information on module installation, please visit the detailed CPAN module installation guide.