我想发送.jog图像到客户端,但我失败了。如何提供图像到客户端nodejs和角
app.get('/image', function(req, res){;
res.sendfile(path.resolve(path.resolve(__dirname,'/Imagepath/image.jpg")));
});
在我的角侧
$http({
method:'GET',
url:'/image',
}).then(function (response){
$scope.image= response.data;
})
<img id="imgid" ng-src="{{image}}" width="500" height="400"/>
的问题是,该响应是一些二进制数据。我怎样才能让它发送可以显示在img src上的数据。如何在客户端的服务器文件夹中显示图像?谢谢。