1 2 3 4 5 6 7 8 9
hook before_routes => sub { my $c = shift; if ("/foo//bar" eq $c->req->url->path) { $c->req->url->path("/foo/bar"); } }; get '/foo/bar' => sub { shift->render(text => "Hello world"); };
You can clone a snippet to your computer for local editing. Learn more.