I have to check the HOST of the http request, if it's equal to example.com or www.example.com, I have to do a 301 redirect.
How can I do this using Node.js and Express Web Framework?
I have to check the HOST of the http request, if it's equal to example.com or www.example.com, I have to do a 301 redirect.
How can I do this using Node.js and Express Web Framework?
Today for me it's req.host, req.hostname and req.headers.host - I'm going with req.host though.