This commit is contained in:
2026-08-22 23:59:41 -06:00
parent 84893662ca
commit a89b275313
23 changed files with 374 additions and 39 deletions

View File

@@ -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;
}
}