This app will detect your visitor's IP address, hostname, location, user agent and weather information using Hapi.js and Scooter as well as third-party sources, i.e. IPinfo and OpenWeatherMap.
You may set the following environment variables.
- Port number:
PORT
(optional, default value: 3000) - API token (IPinfo):
API_TOKEN
(optional) - API token (OpenWeatherMap):
API_TOKEN_OWM
(optional)
By default, the Node app will run on port 3000.
npm install
node app.js
You may test the app using the below curl
, http
, fetch
or wget
commands.
curl http://localhost:3000/
curl http://localhost:3000/ip
curl http://localhost:3000/hostname
curl http://localhost:3000/city
curl http://localhost:3000/country
curl http://localhost:3000/agent
curl http://localhost:3000/weather
You may check for open ports on your host like so:
curl http://localhost:3000/port/3000
Bug reports and pull requests are welcome on GitHub at https://github.com/schopenhauer/iam.js.
The module is available as open source under the terms of the MIT License.