Created
July 27, 2020 10:46
-
-
Save pdashford/954293c2ee395c596377d1ccb5f4fbb4 to your computer and use it in GitHub Desktop.
Revisions
-
pdashford created this gist
Jul 27, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ export async function getIpMeta(ipAddr) { try { const url = `http://api.ipstack.com/${ipAddr}?access_key=youraccesskey` const result = await request.get(url, { headers: { 'content-type': 'application/json; charset=utf-8' } }) return JSON.parse(result) } catch (e) { console.error('error', e) return undefined } }