NAME
Terse::App - Multiple controllers build an app.
VERSION
Version 0.100
SYNOPSIS
.. My/App.pm
package My::App;
use base 'Terse::App';
sub login :any {
return 1;
}
sub auth_prevent :any(auth) {
return 0;
}
sub auth :get :post {
return 1;
}
... My/App/Controller/Hello.pm
package My::App::Controller::Hello;
use base 'Terse::Controller';
sub hello :get {
... #1
}
sub world :get {
... #2
}
... My/App/Controller/Hello/World.pm
package My::App::Controller::Hello::World;
use base 'Terse::Controller';
sub world :get {
... #3
}
.... MyApp.psgi ...
use Terse;
use My::App;
our $app = My::App->start();
sub {
my ($env) = (shift);
Terse->run(
plack_env => $env,
application => $app,
);
};
....
plackup MyApp.psgi
GET http://localhost:5000/hello?id=here&other=params #1
GET http://localhost:5000/hello?req=world #2
GET http://localhost:5000/hello/world #3
AUTHOR
LNATION, <email at lnation.org>