Skip to content

itsdrnoob/DataMonitorWeb

Repository files navigation

Platform License Chat Status

Data Monitor Web

Introduction

Data Monitor Web contains a set of utilities to help with Data Monitor.


Installation

  1. Clone the repo:
    git clone https://github.com/itsdrnoob/DataMonitorWeb.git
  2. Switch to the working directory:
    cd DataMonitorWeb
  3. Install the required dependencies:
    npm install
  4. Create a .env file and add the following variables to it:
    TOKEN = <ACCESS_TOKEN>
    IP_TOKEN = <TOKEN FROM ipinfo.io>
    
  5. Start the server:
    npm start

Endpoints

  • /fetchIp

    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
  • /ipLookup

    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

Rate Limiting

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.


Contributing

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.

License

DataMonitorWeb is released under GPL-3.0 license. Click here for more information.


Dependencies

Details regarding dependencies used in the project can be found in the dependencies.json file.