Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
koa-location-filter
Advanced tools
koa middleware filtering requests depenging on user's location
Middleware for Koa realizing filtering via user's location.
Install with npm
$ npm install koa-location-filter --save
This module works detects the location of client by requests to following providers:
You can to make list of countries access is denied from. The can be added into the list by code. List of countrues and their codes: geonames
For each country you can specify the reponse message. Response will be with code status 404.
var Koa = require('koa');
var app = new Koa();
var filter = require('koa-location-filter');
filter(app, {
blackList: {
RU: 'Вам запрещён доступ',
BG: 'Ne moze bee',
US: 'Access is denied'
}
});
app.use(async (ctx, next) => {
ctx.body = 'Success';
});
var port = 8000;
app.listen(port, ()=> {
console.log('Сервер работает на порту ' + port);
});
FAQs
koa middleware filtering requests depenging on user's location
The npm package koa-location-filter receives a total of 0 weekly downloads. As such, koa-location-filter popularity was classified as not popular.
We found that koa-location-filter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.