An open API service indexing awesome lists of open source software.

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.

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