Skip to content

Instantly share code, notes, and snippets.

@hisaichi5518
Created November 5, 2011 07:22
Show Gist options
  • Save hisaichi5518/1341231 to your computer and use it in GitHub Desktop.
Save hisaichi5518/1341231 to your computer and use it in GitHub Desktop.
Malts::Web::Router::Simple::Declare
package MyApp::Web;
use strict;
use warnings;
use parent qw(Malts Malts::Web);
sub startup {
my ($self) = @_;
MyApp::Web::Dispatcher->dispatch($self) or $self->not_found;
}
package MyApp::Web::Dispatcher;
use strict;
use warnings;
use Malts::Web::Router::Simple::Declare;
get '/' => 'Root#index';
Malts::Util::DEBUG && print router_as_string;
package MyApp::Web::Controller::Root;
use strict;
use warnings;
use FindBin;
$INC{'MyApp/Web/Controller/Root.pm'} = $FindBin::Bin;
sub index { $_[1]->ok('index!') }
package main;
use strict;
use warnings;
MyApp::Web->to_app;
=pod
テストしづらいのでどうにかしたい。
=cut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment