How to stop routes from shadowing other routes? #96
Answered
by
bbrtj
rawleyfowler
asked this question in
Q&A
-
|
I have the following routes: $r->add( [ GET => '/summary' ] => 'get_annual_expense_summary' );
$r->add( [ GET => '/:expense_id' ] => 'get_expense' ); # called when /summary is called.How can I stop Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
bbrtj
Aug 4, 2025
Replies: 1 comment
-
|
Kelp has some tools to deal with this:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rawleyfowler
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Kelp has some tools to deal with this:
expense_idwill have a known format (whichsummarydoes not meet), you can put a check on the placeholder: https://metacpan.org/pod/Kelp::Routes#checksummaryroute earlier by reducing its order value: https://metacpan.org/dist/Kelp/view/lib/Kelp/Manual.pod#Route-order