stuff
This commit is contained in:
@@ -15,6 +15,7 @@ has _router => (
|
||||
{
|
||||
## no critic [TestingAndDebugging::ProhibitNoStrict]
|
||||
no strict 'refs';
|
||||
|
||||
for (qw(get post put patch delete)) {
|
||||
*{ __PACKAGE__ . '::' . $_ } = sub {
|
||||
my ( $self, $path ) = @_;
|
||||
@@ -23,6 +24,10 @@ has _router => (
|
||||
|
||||
my $route = CW::Route->new( path => $path );
|
||||
$self->_router->connect( $path, { route => $route } );
|
||||
if ( $path !~ /.*\/$/ ) {
|
||||
$self->_router->connect( "$path/", { route => $route } );
|
||||
}
|
||||
|
||||
return $route;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user