OX::Application::Role::Router::Path::Router - implementation of OX::Application::Role::Router which uses Path::Router
version 0.14
package MyApp; use Moose; extends 'OX::Application'; with 'OX::Application::Role::Router::Path::Router'; sub configure_router { my ($self, $router) = @_; $router->add_route('/', target => sub { "Hello world" } ); }
This role uses Path::Router to provide a router for your application. It uses OX::Application::Role::Router, and overrides router_class to be Path::Router and app_from_router to create an app using Plack::App::Path::Router::Custom. It also uses OX::Application::Role::Request to allow the application code to use OX::Request instead of bare environment hashrefs.
router_class
Path::Router
app_from_router
See OX::Application::Role::RouterConfig for a more convenient way to implement configure_router.
configure_router
Stevan Little <stevan.little@iinteractive.com>
Jesse Luehrs <doy@tozt.net>
This software is copyright (c) 2014 by Infinity Interactive.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install OX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OX
CPAN shell
perl -MCPAN -e shell install OX
For more information on module installation, please visit the detailed CPAN module installation guide.