Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email address in URL #30

Open
Dam-Buty opened this issue Jun 19, 2017 · 0 comments
Open

Email address in URL #30

Dam-Buty opened this issue Jun 19, 2017 · 0 comments

Comments

@Dam-Buty
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant