Created
June 24, 2011 16:36
-
-
Save yko/1045160 to your computer and use it in GitHub Desktop.
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 Foo; | |
use Mojo::Base 'Mojolicious'; | |
# This method will run once at server start | |
sub startup { | |
my $self = shift; | |
# Routes | |
my $r = $self->routes; | |
# Normal route to controller | |
my $foo = $r->route('/api')->to('bar#baz', namespace => 'Example'); | |
$foo->route('/nested')->to('bar#nested'); | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment