Rumi is lightweight web application framework for me.
use lib "./lib";
use MyApp::Web;
use Plack::Builder;
my $web = MyApp::Web->new;
my $app = $web->to_app();
builder {
enable "Plack::Middleware::Static",
path => qr{^/(favicon\.ico|images/|js/|css/)},
root => './htdocs/';
enable_if { $_[0]->{REMOTE_ADDR} eq '127.0.0.1' }
"Plack::Middleware::ReverseProxy";
enable "Plack::Middleware::AccessLog", format => "combined";
$app;
};
package MyApp::Web;
use strict;
use warnings;
use parent qw/Rumi::Web/;
use Text::Xslate;
sub install_view {
my $view = Text::Xslate->new(
path => ['./tmpl'],
header => ['header.tt2'],
footer => ['footer.tt2'],
syntax => 'TTerse',
);
return { default => $view };
}
1;
package MyApp::Web::Dispatcher;
use strict;
use warnings;
use Rumi::Web::Dispatcher;
connect '/' => { controller => 'Root', action => 'index' };
1;
package MyApp::Web::Controller::Root;
use strict;
use warnings;
sub index {
my ( $self, $c ) = @_;
return 'index.tt2', {};
}
1;
- Plack::Request
- Router::Simple
- (Text::Xslate)
- Writing tests
- Setup script
- Session
- Yusuke Wada
- http://yusukebe.com/
- yusuke@kamawada.com