I am trying to setup an API that will return an image from my google places API using google's photo reference ID as a parameter. This is what I have so far:
module.exports.getPhoto=function(req,res){
var id=req.params.id;
var url='https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference='+id+'&key='+process.env.GOOGLEAPI;
request.get(url, function (err,response,body) {
if(err){
res.status(400).json(err);
}else{
res.send(body);
}
});
};
Right now the body is not sending in the correct format. Is there a way to do this with out saving it as a file and then sending it?
via Travis Mair
No comments:
Post a Comment