@live-change/geoip-service 0.8.63 → 0.8.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/geoip.js +2 -3
- package/package.json +3 -3
package/geoip.js
CHANGED
|
@@ -11,6 +11,7 @@ async function getGeoIp(ip) {
|
|
|
11
11
|
if(!ip) return defaultCountry
|
|
12
12
|
if(ip === '1' || ip.slice(0,4) === '127.') return defaultCountry
|
|
13
13
|
return countryDatabase.then(db => {
|
|
14
|
+
console.log('GEOIP', db, ip)
|
|
14
15
|
let result = db.get(ip)
|
|
15
16
|
if(!result) return defaultCountry
|
|
16
17
|
if(!result.country) return defaultCountry
|
|
@@ -24,15 +25,13 @@ async function getGeoIp(ip) {
|
|
|
24
25
|
definition.view({
|
|
25
26
|
name: "myCountry",
|
|
26
27
|
properties: {
|
|
27
|
-
ip: {
|
|
28
|
-
type: String
|
|
29
|
-
}
|
|
30
28
|
},
|
|
31
29
|
returns: {
|
|
32
30
|
type: String
|
|
33
31
|
},
|
|
34
32
|
remote: true,
|
|
35
33
|
async fetch(props, { client, context }) {
|
|
34
|
+
client.ip = '137.74.93.199'
|
|
36
35
|
const geoIpResult = await getGeoIp(client.ip)
|
|
37
36
|
console.log('GEOIP', client.ip, '=>', geoIpResult)
|
|
38
37
|
return geoIpResult
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/geoip-service",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.65",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"url": "https://www.viamage.com/"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@live-change/framework": "^0.8.
|
|
24
|
+
"@live-change/framework": "^0.8.65",
|
|
25
25
|
"maxmind": "^3.0.3"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "c239699e9aea10bb7ae0baca0ab980ff1d9f5f94",
|
|
28
28
|
"type": "module"
|
|
29
29
|
}
|