An express module for getting IP information using fast-geoip.
npm install express-fast-ip
import {ip, ipInfo} from 'express-fast-ip';
import * as express from 'express';
const app = express();
app.use(ip);
app.get('/', function (req, res) {
res.send(req.ipInfo);
});
// It is also possible to fetch ip information programatically
console.log(
await ipInfo(),
);
const express = require('express');
const app = express();
const {ip, ipInfo} = require('express-fast-ip');
app.use(ip);
app.get('/', function (req, res) {
res.send(req.ipInfo);
});
// It is also possible to fetch ip information programatically
console.log(
await ipInfo(),
);
Eduardo Nuzzi eduardomnuzzi@gmail.com
Feel free to contribute to this project.
If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a new feature, please send a pull request.
Huge thanks to Oyetoke Toby for implementing the code that inspired this lib.