Update /bin/bouncy.js to support wildcard characters (*) for sub-domains... #29

wants to merge 1 commit into


None yet
4 participants

I believe the added algorithm at line 16 would allow for "*.mydomain.com" routes to be matched by "www.mydomain.com", "foobar.mydomain.com", etc.


substack commented Mar 27, 2012

I bet there is a wildcard module somewhere that has a more robust and well-tested recursive algorithm for this. Or perhaps fall into regex mode if the first and last characters in the key are '/'.

Could maybe do both. A regex syntax would be great for real advanced pattern matching. While a simple wildcard syntax would be great too for the regular matching.

I've tested the changes with ".mydomain.com". It matches "www.mydomain.com" and "www.shop.mydomain.com". I've also tried ".shop.mydomain.com" which matches "www.shop.mydomain.com" and "www.my.shop.mydomain.com", but not "www.mydomain.com". You should try it out as well.

keverw commented Jun 16, 2012

This would be a nice feature! Like I have it go to my WordPress Network install, so for each new subdomain, I have to add to the routes.json file.


contra commented Sep 26, 2012

I think isaacs minimatch module would be a good fit for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment