https://github.com/yusukebe/rumi
Yet Anothor Girl, just web application framework.
https://github.com/yusukebe/rumi
Last synced: 11 months ago
JSON representation
Yet Anothor Girl, just web application framework.
- Host: GitHub
- URL: https://github.com/yusukebe/rumi
- Owner: yusukebe
- Created: 2011-01-19T06:30:38.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2011-04-10T06:20:42.000Z (about 15 years ago)
- Last Synced: 2025-04-19T04:28:54.724Z (about 1 year ago)
- Language: Perl
- Homepage: http://yusukebe.com/
- Size: 113 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.mkdn
- Changelog: Changes
Awesome Lists containing this project
README
# Rumi - yet another girl.
Rumi is lightweight web application framework for me.
## Example
### myapp.psgi
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;
};
### MyApp/Web.pm
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;
### MyApp/Web/Dispatcher.pm
package MyApp::Web::Dispatcher;
use strict;
use warnings;
use Rumi::Web::Dispatcher;
connect '/' => { controller => 'Root', action => 'index' };
1;
### MyApp/Web/Controller/Root.pm
package MyApp::Web::Controller::Root;
use strict;
use warnings;
sub index {
my ( $self, $c ) = @_;
return 'index.tt2', {};
}
1;
## Core required modules.
- Plack::Request
- Router::Simple
- (Text::Xslate)
## TODO
- Writing tests
- Setup script
- Session
## AUTHOR
- Yusuke Wada
- http://yusukebe.com/
- yusuke@kamawada.com