FIx No such file GeoLite2-Conutry.mmdb on Netlify (v1.37.0)

pull/1443/head
Sachin Chaurasiya 2022-08-19 14:08:32 +05:30
parent 0f976be5d8
commit b3ec60be91
2 changed files with 2 additions and 2 deletions

View File

@ -68,7 +68,7 @@ export async function getCountry(req, ip) {
// Database lookup
if (!lookup) {
lookup = await maxmind.open(path.resolve('node_modules/.geo/GeoLite2-Country.mmdb'));
lookup = await maxmind.open(path.resolve('./public/geo/GeoLite2-Country.mmdb'));
}
const result = lookup.get(ip);

View File

@ -14,7 +14,7 @@ if (process.env.MAXMIND_LICENSE_KEY) {
`?edition_id=GeoLite2-Country&license_key=${process.env.MAXMIND_LICENSE_KEY}&suffix=tar.gz`;
}
const dest = path.resolve(__dirname, '../node_modules/.geo');
const dest = path.resolve(__dirname, '../public/geo');
if (!fs.existsSync(dest)) {
fs.mkdirSync(dest);