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

hostname pattern matching #13

Open
tj opened this issue Mar 26, 2014 · 2 comments
Open

hostname pattern matching #13

tj opened this issue Mar 26, 2014 · 2 comments

Comments

@tj
Copy link
Member

tj commented Mar 26, 2014

--name and --host are advertised as supporting patterns right now, but it would be handy to do --host api-* etc

@jpillora
Copy link

+1 instead of a regex literal, most of the time you just want a simple wildcard. Maybe this String -> RegExp conversion strategy?

[Strings] are converted to a regular expressions by escaping all non-alphanumeric chars, then converting * into .* and finally wrapping it with ^ and $.
...
Where "/api/*.json" becomes the RegExp /^\/api\/.*\.json$/

@tj
Copy link
Member Author

tj commented Mar 26, 2014

I have a util already for glob-ish -> regexp, it's just not implemented yet in lib/server.js

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

2 participants