Data Monitor Web contains a set of utilities to help with Data Monitor.
- Clone the repo:
git clone https://github.com/itsdrnoob/DataMonitorWeb.git
- Switch to the working directory:
cd DataMonitorWeb
- Install the required dependencies:
npm install
- Create a
.env
file and add the following variables to it:TOKEN = <ACCESS_TOKEN> IP_TOKEN = <TOKEN FROM ipinfo.io>
- Start the server:
npm start
-
This endpoint accepts a GET request and returns the IP address of the requested user in a string format. On localhost it will return 127.0.0.1 if you're using IPv4 or ::1, ::ffff:127.0.0.1 if you're using IPv6.
Request
GET /fetchIp
Response
192.168.0.1
-
This endpoint accepts a GET request along with a header
token
that contains the API key. If the token is valid, the endpoint returns a JSON containing the requested user's IP address, city, region, country, and network provider.Request
GET /ipLookup
Response
{ "ip": "192.168.0.1", "city": "New York", "region": "NY", "country": "US", "org": "AT&T Services, Inc." }
Header
Field Type Required Description token String Yes Specifies the access token
The endpoint /ipLookup
is rate-limited to prevent abuse. Users can make a maximum of 25 requests every 10 minutes. If the rate limit is exceeded, the API returns HTTP Error 429.
Contributions to the project are always welcome. Here are a few guidelines to help you get started:
- Fork the project and create a new branch for your changes.
- Make your changes and test them thoroughly.
- If fixing an already reported bug, make sure to mention 'Fixes #' in the desctiption.
- Submit a pull request.
DataMonitorWeb is released under GPL-3.0 license. Click here for more information.
Details regarding dependencies used in the project can be found in the dependencies.json file.