Once i open 'localhost:3000' , the image is getting downloaded to my laptop instead of being displayed on the webpage , can anyone please help me out ?
var express= require('express');
var fs = require('fs');
var app= express();
var imgpath= 'C:\Users\Rohit\Downloads\images.jpg';
app.get('/',function(req,res){
res.send(fs.readFileSync(imgpath));
});
app.listen(3000);
console.log('listening');
res.render('<view_file>');and in that view write<img src = "path">to display on webpage.