Welcome aboard! We are happy you are here and wish you good net-raft!
// at first you must install "npm install --save path"
// then insert the following code into app.js
var http = require('http');
var path = require('path');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
var userName = process.env['USERPROFILE'].split(path.sep)[2];
var loginId1 = path.join("domainName",userName);
res.write(loginId1 + '<br>');
res.end();
}).listen(3000);
console.log("Listening to Port 3000");
// type "node app.js" in command prompt
The most helpful NODEJS solutions
get user ipNODEJS Click to see more ... 7.6K 1.7K