Express middleware for getting client IP address and location.
Add to your project's package.json
dependancies:
...
"dependencies": {
"ip-location-middleware": "https://github.com/obe711/ip-location-middleware",
...
}
Then in your app.js
or server.js
file:
const ipLoc = require('ip-location-middleware');
// MY_API_KEY is your API key for the iploc API
app.use(ipLoc(MY_API_KEY));