Skip to content

Express 4 middleware to add req.countryCode, which is the ISO alpha 2 country code, to requests.

License

Notifications You must be signed in to change notification settings

mikemaccana/express-geoip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express GeoIP

Express 4 middleware to add req.countryCode, which is the ISO alpha 2 country code for a request.

Usage

In app.js

var expressGeoIP = require('express-geoip');

app.use(expressGeoIP('US').getCountryCodeMiddleware);

Then, in your routes, check req.countryCode for the looked up country code.

History

1.2.0 - Added tests, new function signature

1.0.0 - Initial release

About

Express 4 middleware to add req.countryCode, which is the ISO alpha 2 country code, to requests.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •