senchalabs/connect — pull request #770 by johnhenry (2013-04-01 06:07:10+00:00)
Title: Added domains middleware - adds heiarchy of domains and subdomains to request

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

It adds an array of domains to the request object as req.domains.

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

All subsequent items are subdomains

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