README
Installation
npm install country-detector
Usage
app.use countryDetector.getMiddleware('./GeoLite2-City.mmdb', {
cookieName: 'country'
cookieMaxAge: 946707779241
})
...
console.log req.country
Country detector middleware for Express.js via maxmind-db-reader
<script type="module">
import countryDetector from 'https://cdn.skypack.dev/country-detector';
</script>
npm install country-detector
app.use countryDetector.getMiddleware('./GeoLite2-City.mmdb', {
cookieName: 'country'
cookieMaxAge: 946707779241
})
...
console.log req.country