How can I get the server name for where node.js is running? -


i want add line point different database depending on server running node.js on (localhost vs test.com, etc). how server name in node.js? is, server side equivalent location.host?

var os = require('os'); os.hostname(); 

link


Comments

Popular posts from this blog

javascript - ScrollTo Effect (href to div) -

javascript - document.registerElement extending HTMLInputElement prototype while using custom tag name to avoid implicit browser style -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -