host header more explicit

This commit is contained in:
Marco Bettiolo 2014-05-16 02:14:52 +01:00
parent 820d3248ca
commit 7879e6fdff

View file

@ -18,6 +18,7 @@ var server = http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'}); res.writeHead(200, {'Content-Type': 'text/plain'});
res.write('This is a node.js echo service\n'); res.write('This is a node.js echo service\n');
res.write('Host: ' + req.headers.host + '\n');
res.write('\n'); res.write('\n');
res.write('node.js Production Mode: ' + (nodeEnv == 'production' ? 'yes' : 'no') + '\n'); res.write('node.js Production Mode: ' + (nodeEnv == 'production' ? 'yes' : 'no') + '\n');
res.write('\n'); res.write('\n');