add cookie. add city database

pull/1644/head
Sergei Meza 2022-10-18 16:18:55 +09:00
parent 55dfea1aba
commit e18ce22784
1 changed files with 3 additions and 0 deletions

View File

@ -1,3 +1,4 @@
/* eslint-disable no-console */
import path from 'path';
import requestIp from 'request-ip';
import { browserName, detectOS } from 'detect-browser';
@ -74,6 +75,8 @@ export async function getCountry(req, ip) {
const result = lookup.get(ip);
console.log(JSON.stringify(result));
return result?.country?.iso_code;
}