Welcome aboard! We are happy you are here and wish you good net-raft!
var http = require('http');
const https = require('https');
var fs = require('fs');
http.createServer(function (req, res) {
var file = fs.createWriteStream("mydownloadfile.jpg");
var request = https.get("https://net-raft.com/Images/logo.jpg", function(response) {
response.pipe(file); // save it on your desktop
res.write('<p>the file has been successfully downloaded!<b>');
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