I've been trying to match the following URL:
http://localhost:3000/?uid=Nf83K3L
with app.get(/^\/\?uid.+/, userController.redirectUid) but it's not working.
I've tried to escape the question mark with \? as well, but still doesn't work. Am I doing something wrong, or am I not allowed to match question marks in express routes?
You don't need the carat(^) as it means / should be the beginning of the string you want to match.
app.get(/\/\?uid.+/, userController.redirectUid).
Hope this fixes your issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With