1602/compound — pull request #551 by jpap (2013-07-09 12:52:29+00:00)
Title: New optional virtual host (vhost) feature for routes.

A straightforward alternative to the existing [subdomain route option](http://compoundjs.com/docs/#routing-subdomain).

In the CompoundJS application `config/route.coffee` file, add the vhost option in the 3rd parameter dictionary:
```
exports.routes = (map) ->
map.get "/apples/:id", "fruit#action", {vhost: ".fruit.com"}
map.get "/carrots/:id", "vegetable#action", {vhost: "vegetables.com"}
```

where the `vhost` value is similar to what you would see in a Nginx `server_name` directive:
1. Hostnames starting with a period (".") are treated like wildcards. The first example above matches both "fruit.com" and "www.fruit.com"
2. Are otherwise are treated as exact matches. The second example above only matches "vegetables.com".