Added domains middleware - adds heiarchy of domains and subdomains to request #770

wants to merge 1 commit into


None yet

2 participants


Hello. I've added a new middleware application to Connect called Domains.

It adds an array of domains to the request object as

The first item,[0], is the site domain and is determined by the argument passed into the middleware in the use statement, ie .use("") or .use(

All subsequent items are subdomains

I feel like this would be a welcomed addition to Connect.

tj commented Apr 1, 2013 can just be a prototype method, no reason it has to be middleware really, express has req.subdomains for example. Or even if it's middleware we can keep it third-party for now and add it to the wiki

@tj tj closed this Apr 1, 2013

Sounds good. And thanks for the heads up about req.subdomains in express.

@johnhenry johnhenry deleted the johnhenry:domains branch Apr 7, 2013
@johnhenry johnhenry restored the johnhenry:domains branch Apr 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment