Welcome aboard! We are happy you are here and wish you good net-raft!
var http = require('http');
var fs = require('fs');
http.createServer(function (req, res) {
fs.writeFile('Hello_world.txt', 'Hello world!', function (err) {
if (err) throw err;
res.end("created!");
});
}).listen(3000);
console.log("Listening to Port 3000");
// The fs.writeFile() method replaces the specified file and content if it exists
The most helpful NODEJS solutions
get user ipNODEJS Click to see more ... 7.5K 1.7K