I am new to node. I have been digging around trying to find out how to route an incoming image that I am getting from google drives api. I've tried downloading it but it takes to long. I want to be able to send it to the client as soon as i get it. It's probably simple but all I want to do is save it to a png file. . ant help would be greatly appreciated.
app.get("/img", function(req,res){
https.get(url,function(resp){
console.log(resp.statusCode);
console.log(resp.headers['content-type']);
resp.on("data", function(chunk){
// I am getting the image raw data
.pipe(fs.createWriteStream("public/images/test.png"));