express icon indicating copy to clipboard operation
express copied to clipboard

upgrade path-to-regexp package?

Open hellatan opened this issue 10 years ago • 7 comments

I filed this bug with the path-to-regexp package. However, I noticed that [email protected] is currently using [email protected]. I did a test install with [email protected] and my local instance stopped having those issues in the ticket I linked to.

hellatan avatar Nov 27 '16 18:11 hellatan

Thanks for the poke :) we already have several issues about this and even a PR. Since the upgrade is not backwards compatible it can't be done until express 5.0. I'm going to close this since we have several others open :)

dougwilson avatar Nov 27 '16 18:11 dougwilson

wow that was fast 😄 good to know and I meant to say [email protected], not 3.1.4x. So this upgrade will happen when 5.x is released?

hellatan avatar Nov 27 '16 18:11 hellatan

Yes

dougwilson avatar Nov 27 '16 18:11 dougwilson

@dougwilson can you suggest any workarounds? The only one I can think of based on what you've said is to fork the [email protected] and upgrade the path-to-regexp package in that fork until we can upgrade to 5.x.

hellatan avatar Nov 27 '16 18:11 hellatan

Wait until the main person of the module replies to your bug. That module is part of the Express project, so it's possible there is a bug fix made to the 0.1.x line, which has happened several times. It depends on what the issue is.

Otherwise, just provide a regular expression as your path to express directly instead of a string and you can use whatever kind of expression you desire.

dougwilson avatar Nov 27 '16 18:11 dougwilson

For example, your bug report has:

router.use('/(segment1|segment2|segment3)', someMethod);

You can use the array syntax for that:

router.use(['/segment1', '/segment2', '/segment3'], someMethod);

dougwilson avatar Nov 27 '16 18:11 dougwilson

i went with using an actual regex instead. thanks

hellatan avatar Nov 30 '16 02:11 hellatan