Back to Expressjs

Req Host

_includes/api/en/3x/req-host.md

latest181 B
Original Source
<h3 id='req.host'>req.host</h3>

Returns the hostname from the "Host" header field (void of portno).

js
// Host: "example.com:3000"
console.dir(req.host)
// => 'example.com'