The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Apache::Hendrix - Provides a route-to-sub based web framework

SYNOPSIS

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 { ... }

DETAILS

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.

METHODS

    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

REQUIRED LIBS

Apache2::Const;
Apache2::Request;
Apache2::RequestIO;
Apache2::RequestRec;
Carp;
JSON::XS;
Moose::Exporter;
Moose;
MooseX::FollowPBP;
MooseX::Singleton;
Template;
Tie::Cache;
XML::Simple

REVISION HISTORY

0.1.0 - Initial concept
0.1.1 - Improved construct, first used in production
0.1.2 - Easy of use improved
0.2.0 - Internal structure rewritten
0.3.0 - Update to be compatible with multiple scripts on the same apache session
0.3.5 - First release to CPAN.

AUTHOR

Zack Allison
zedoriah@gmail.com