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 - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

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

java - Reading data from multiple zip files and combining them to one -