@tsevimli/geo-api
v0.0.2
Published
GeoIP API
Downloads
11
Readme
GeoIP - API
Install
npm install @tsevimli/geo-api
# or
git lfs clone https://github.com/timursevimli/geoip-api.git
Usage (API)
npm start # default running on port 8000 or PORT=8000 node main.js
curl "http://localhost:8000?ip=8.8.8.8" # -> {"country":"US"}
# or
curl "http://localhost:8000" # -> return ip of forwarder or sender of the request
Usage (Module)
'use strict';
const { getGeoInfo } = require('geo-api');
console.log(getGeoInfo('8.8.8.8')); //output -> 'US'