add cookie. add city database

This commit is contained in:
Sergei Meza 2022-10-18 16:17:20 +09:00
parent 0336f41e12
commit 55dfea1aba
5 changed files with 38 additions and 5 deletions

View file

@ -68,7 +68,8 @@ 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('node_modules/.geo/GeoLite2-City.mmdb'));
// lookup = await maxmind.open(path.resolve('node_modules/.geo/GeoLite2-Country.mmdb'));
}
const result = lookup.get(ip);