Created
October 3, 2013 21:03
-
-
Save MadMartigan/6817097 to your computer and use it in GitHub Desktop.
Mojolicious bridges
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
my $foo = $r->bridge('/foo')->to(cb => sub { | |
my $self = shift; | |
$self->app->log->debug('foo cb'); | |
return 1; | |
}); | |
$foo->route('/')->to(cb => sub { | |
my $self = shift; | |
$self->app->log->debug('foo/ cb'); | |
$self->render(data => 'foo/ cb') | |
}); | |
$foo->route('bar')->to(cb => sub { | |
my $self = shift; | |
$self->app->log->debug('foo/bar cb'); | |
$self->render(data => 'foo/bar cb') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment