Skip to content

Commit

Permalink
debug: adds locator log
Browse files Browse the repository at this point in the history
  • Loading branch information
migtarx committed Dec 18, 2023
1 parent c4bdd01 commit 19b02f4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/middlewares/locator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ async function locator(req, res, next) {
const response = await fetch(`https://api.iplocation.net/?ip=${ip}`);
const data = await response.json();
const countryName = data.country_name;
console.log(`Request from ${countryName}`)
req.location = countryName;
next();
}
Expand Down

0 comments on commit 19b02f4

Please sign in to comment.