file system read file, exact https path how to given and read file
var path_name : https://example.s3.ap-south-1.amazonaws.com/kc/insp_report1.pdf
var http = require('http');
var fs = require('fs');
http.createServer(function (req, res) {
//Open a file on the server and return its content:
fs.readFile(path_name, function(err, data) {
res.writeHead(200, {'Content-Type': 'application/pdf'});
res.write(data);
return res.end();
});
}).listen(8080);
my error is it will taken my system path also
{ Error: ENOENT: no such file or directory, open 'C:\Users\example\Desktop\react\manyuBackEnd\https:example.s3.ap-south-1.amazonaws.comkcinsp_report1.pdf'