Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikemaccana/express-geoip
Express 4 middleware to add req.countryCode, which is the ISO alpha 2 country code, to requests.
https://github.com/mikemaccana/express-geoip
Last synced: 15 days ago
JSON representation
Express 4 middleware to add req.countryCode, which is the ISO alpha 2 country code, to requests.
- Host: GitHub
- URL: https://github.com/mikemaccana/express-geoip
- Owner: mikemaccana
- License: mit
- Created: 2015-06-08T14:22:39.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-08-27T13:23:27.000Z (about 4 years ago)
- Last Synced: 2024-10-12T01:27:36.059Z (about 1 month ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 6
- Watchers: 3
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 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