Welcome aboard! We are happy you are here and wish you good net-raft!
// at first you install "npm install --save path"
var http = require('http');
var path = require('path');
http.createServer(function (req, res) {
var mypath = '/home/dir/folder/file.txt';
var getfilename = path.parse(mypath).base;
res.write(getfilename);
res.end();
}).listen(3000);
console.log("Listening to Port 3000");
The most helpful NODEJS solutions
get user ipNODEJS Click to see more ... 7.6K 1.7K