Node version 18 or above (version >= 18).
Create .env
in the root directory with the following:
PORT=3000
MONGO_URI=<your-mongo-uri>
IPWHO_URL=http://ipwho.is
With NPM
# development
$ npm run dev
# production
$ npm run start
With Yarn
# development
$ yarn dev
# production
$ npm run start
Check IP Geolocation information via https://ipwhois.io/
-
Endpoint:
GET /api/ip-info/:ip
-
Response: JSON object with details of IP address location.
-
Example:
GET /api/ip-info/8.8.8.8