I am trying to send .jog images to the client but I fail.
app.get('/image', function(req, res){;
res.sendfile(path.resolve(path.resolve(__dirname,'/Imagepath/image.jpg")));
});
on my angular side
$http({
method:'GET',
url:'/image',
}).then(function (response){
$scope.image= response.data;
})
<img id="imgid" ng-src="{{image}}" width="500" height="400"/>
The problem is that the response is some binary data. How can I get it to send me data that can be displayed on the img src. How can I show images in my server folder on the client side?Thank you.