From 4896d8f4192a7f1473922475350c1675c05633da Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 3 Dec 2020 18:35:41 +0100 Subject: Allow arbitrary stop names without city prefix This fixes stops such as "Foostr.". Previously, dots were only supported in stop names prefixed by a city name (/:city/*stop). As Mojolicious matches routes in the order they appear in and proceeds once a match has been found, allowing both /:city/*stop and later /*stop is not a problem. --- index.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.pl b/index.pl index 60436de..6dcee58 100644 --- a/index.pl +++ b/index.pl @@ -694,10 +694,10 @@ get '/:city/<*stop>.html' => \&render_html; get '/:city/<*stop>.json' => \&render_json; get '/:city/<*stop>.png' => \&render_image; get '/:city/*stop' => \&handle_request; -get '/<:stop>.html' => \&render_html; -get '/<:stop>.json' => \&render_json; -get '/<:stop>.png' => \&render_image; -get '/:stop' => \&handle_request; +get '/<*stop>.html' => \&render_html; +get '/<*stop>.json' => \&render_json; +get '/<*stop>.png' => \&render_image; +get '/*stop' => \&handle_request; app->config( hypnotoad => { -- cgit v1.2.3