fix/geolocation api key

This commit is contained in:
SowinskiBraeden committed 2025-05-08 18:14:22 -07:00
1 parent ed06b8731d
commit 5763f03288
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -38,7 +38,7 @@ function update(data) {
dropdown.appendChild(listItem); dropdown.appendChild(listItem);
}); });
console.log(data); // console.log(data);
} }
function switchButton(clickedButton) { function switchButton(clickedButton) {
+1 -1
View File
@@ -505,7 +505,7 @@ module.exports = (middleware, users, plans, assets) => {
}); });
router.get("/exRates/:lat/:lon", async (req, res) => { router.get("/exRates/:lat/:lon", async (req, res) => {
if (!req.session.geoData.country) { if (!req.session.geoData.country) {
const response = await fetch(`https://maps.googleapis.com/maps/api/geocode/json?latlng=${req.params.lat},${req.params.lon}&result_type=country&key=${process.env.geolocation_api}`); const response = await fetch(`https://maps.googleapis.com/maps/api/geocode/json?latlng=${req.params.lat},${req.params.lon}&result_type=country&key=${process.env.GEOLOCATION_API}`);
const data = await response.json(); const data = await response.json();
country = data.results[0].formatted_address; country = data.results[0].formatted_address;