You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for node-simple-router, it is my GOTO router whenever i need to spin up a quick node API server. The minimalist community thanks you dearly :D
I've recently come to a project where i can possibly have an email address in a part of the URL : http://someserver.co/endpoint/test@gmail.com/action . Unfortunately this is not allowed by the default regex in router.coffee.
After a bit of fiddling around in the code, i found that regex is actually exposed as an option, so i just initialized my router with :
const router = new Router({
regex: "/([A-Za-z0-9_\\-\\.@]+)"
})
Nothing ground-breaking but i figured it might be worthwhile to either change the default regex (although there might be some unintended side-effects - i'll let you be the judge of that), or at the very least document regex in the README. I am more than willing to propose a PR depending on what choice you land on.
Cheers,
DAM
The text was updated successfully, but these errors were encountered:
First of all, thanks for node-simple-router, it is my GOTO router whenever i need to spin up a quick node API server. The minimalist community thanks you dearly :D
I've recently come to a project where i can possibly have an email address in a part of the URL : http://someserver.co/endpoint/test@gmail.com/action . Unfortunately this is not allowed by the default regex in router.coffee.
After a bit of fiddling around in the code, i found that
regex
is actually exposed as an option, so i just initialized my router with :Nothing ground-breaking but i figured it might be worthwhile to either change the default regex (although there might be some unintended side-effects - i'll let you be the judge of that), or at the very least document
regex
in the README. I am more than willing to propose a PR depending on what choice you land on.Cheers,
DAM
The text was updated successfully, but these errors were encountered: