travopti/backend/models/getPlacePhoto.js

11 lines
310 B
JavaScript

const axios = require("axios")
module.exports = async (photoref) => {
const res = await axios.get(
`https://maps.googleapis.com/maps/api/place/photo?photoreference=${photoref}&maxwidth=1600&key=${process.env.GOOGLE_CLOUD_APIS}`
);
const url = res.request.res.responseUrl
return url
}