Files
expressjs.com/_includes/api/en/4x/req-subdomains.md
Douglas Christopher Wilson faa6bb9e0a Apply StandardJS style to API docs
2019-05-26 22:47:09 -04:00

433 B

req.subdomains

An array of subdomains in the domain name of the request.

// Host: "tobi.ferrets.example.com"
console.dir(req.subdomains)
// => ['ferrets', 'tobi']

The application property subdomain offset, which defaults to 2, is used for determining the beginning of the subdomain segments. To change this behavior, change its value using [app.set](/{{ page.lang }}/4x/api.html#app.set).