0.1.0 • Published 10 years ago

native-geoip-middleware v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

GeoIP Middleware

Basic middleware for Node.js applications, featuring the native implementation of GeoIP.

Installation

$ npm install native-geoip-middleware --save

It will also install the GeoIP-Lite library, which may take a long time.

Usage

The example uses Express as the example.

var express = require('express'),
	app = express(),
	geoIP = require('native-geoip-middleware');

app.use(geoIP);

app.get('/', function(req, res) {
	res.status(200).send('Hello, user from ' + req.geo.city);
	// "Hello, user from San Francisco"
});

req.geo

Basically, it looks exactly like this.

0.1.0

10 years ago