hostname pattern matching
tj opened this issue · comments
TJ Holowaychuk commented
--name
and --host
are advertised as supporting patterns right now, but it would be handy to do --host api-*
etc
Jaime Pillora commented
+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 Holowaychuk commented
I have a util already for glob-ish -> regexp, it's just not implemented yet in lib/server.js