Try reverting to country database.
This commit is contained in:
@@ -63,7 +63,7 @@ export async function getLocation(ip) {
|
|||||||
|
|
||||||
// Database lookup
|
// Database lookup
|
||||||
if (!lookup) {
|
if (!lookup) {
|
||||||
lookup = await maxmind.open(path.resolve('node_modules/.geo/GeoLite2-City.mmdb'));
|
lookup = await maxmind.open(path.resolve('node_modules/.geo/GeoLite2-Country.mmdb'));
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = lookup.get(ip);
|
const result = lookup.get(ip);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const zlib = require('zlib');
|
|||||||
const tar = require('tar');
|
const tar = require('tar');
|
||||||
|
|
||||||
let url =
|
let url =
|
||||||
'https://raw.githubusercontent.com/GitSquared/node-geolite2-redist/master/redist/GeoLite2-City.tar.gz';
|
'https://raw.githubusercontent.com/GitSquared/node-geolite2-redist/master/redist/GeoLite2-Country.tar.gz';
|
||||||
|
|
||||||
if (process.env.MAXMIND_LICENSE_KEY) {
|
if (process.env.MAXMIND_LICENSE_KEY) {
|
||||||
url =
|
url =
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"functions": {
|
|
||||||
"pages/api/**/*": {
|
|
||||||
"includeFiles": "node_modules/.geo/**"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user