Created
November 5, 2011 07:22
-
-
Save hisaichi5518/1341231 to your computer and use it in GitHub Desktop.
Malts::Web::Router::Simple::Declare
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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