This file contains hidden or 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 Mojolicious::Lite::GetPost; | |
use Mojo::Base -base; | |
use Mojo::Util 'monkey_patch'; | |
sub import { | |
my $caller = caller; | |
monkey_patch $caller, 'get_post', sub { | |
return $caller->app->routes->any([qw(GET POST)] => @_); | |
}; |