Replies: 2 comments
-
No, the router uses regular expressions internally so it is impossible to protect from conflicting routes. Trying to make warnings for some cases would be pointless, since there is way too many. It is something users just need to be aware of. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Regexes, right. Yep... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
(skip to TL;DR if ... you know)
I've manually removed date stamps from logs, trimmed outputs in some places and run everything under
carton v1.0.21
but falsified it to look like everything is installed globally.Long winding path, that eventually gets to the point
In direct defiance of
Mojolicious::Guides::Growing
I like to split a growing::Lite
app up into severalMyApp::Lite::SpecificThing
packages full of further::Lite
apps and then duct tape them back together withMojolicious::Plugin::Mojolyst
.Today I managed to mis-edit one of my
::SpecificThing
's and ended up with aget "/" => sub ...
in two places, whichMojolyst
cheerfully merged intoMyApp
's routes.myapp routes
showed me bothget /
s in the list - one of them was bogus, and lead tocan't render a response
which I've since fixed, but while trying to get my head around it I wrote a repro case that I thought should explode:badapp
:but it didn't explode, Mojo seems totally Ok with just ... having two routes with the same verb+path:
Not a care in the world about it, not even a warning:
TL;DR
... as we can see
Mojolicious::Router
allows you to have two routes with the same verb/pathIf it's Ok for there to be two
get /
s, shouldMojolicious::Command::routes
show the file/package/line where each was declared (which involves somecaller
tracking::Routes
)If it's not Ok, should
::Routes
produce a (possibly%ENV
-guarded) error/warning about it?Beta Was this translation helpful? Give feedback.
All reactions