Today we’ll see how we can get our user’s city, state, and country location information using their IP address and a from a free library and database called IP2Location.
Since, when working locally in NodeJS/AdonisJS our IP address is going to be localhost (127.0.0.1), I’ve gone ahead and grabbed three different IP addresses from my VPN for us to use as examples.
Chicago, United States: 107.150.29.169
Frankfurt, Germany: 45.87.212.78
Stockholm, Sweden: 149.50.216.74