Created
August 23, 2011 03:39
-
-
Save Akron/1164293 to your computer and use it in GitHub Desktop.
Add_shortcut goes wrong ...?
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
#/usr/bin/env perl | |
package Test; | |
use Mojo::Base 'Mojolicious'; | |
sub startup { | |
my $m = shift; | |
my $r = $m->routes; | |
$r->add_shortcut( | |
'do_via' => sub { | |
$_[0]->via('get')->to('hm#get'); | |
$_[0]->via('post')->to('hm#post'); | |
}); | |
$r->route('/')->do_via; | |
}; | |
package main; | |
Test->start('routes'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/usr/bin/env perl
package Test;
use Mojo::Base 'Mojolicious';
sub startup {
my $m = shift;
};
package main;
Test->start('routes');