Giter Site home page Giter Site logo

uptimechecker's Introduction

uptimechecker

Tool used to check status of various websites, services, and endpoints generally.

Currently only available as a NodeJS server.

Installation

Compile it yourself

  1. Clone this repository.
  2. Run npm i in the root.
  3. Run npx tsc in the root.
  4. Start the server with node build/index.js
  5. Enjoy.

Download the compiled build

  1. Install the latest build from releases.
  2. Run node build/index.js
  3. Enjoy.

Usage:

Simply send a get request to the server with the following encapsulated parameters:

{
    "endpoints": [
        {
            "url": "https://domain.com/anything",
            "method": "get"
        },
        {
            "url": "https://google.com",
            "method": "get"
        }
    ]
}

Use any available methods to to encapsulate the config JSON, but the example for the JSON above should look like this:

%7B%0A%20%20%20%20%22endpoints%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22url%22%3A%20%22domain.com%2Fanything%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22method%22%3A%20%22get%22%0A%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22url%22%3A%20%22google.com%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22method%22%3A%20%22get%22%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%5D%0A%7D

To check uptime of all endpoints in the config, simply send a GET request like this:

GET 127.0.0.1:3000/check/encapsulatedConfig

The response of this request will look like this:

[
    {
        "url": "https://domain.com/anything",
        "status": 404,
        "statusMessage": "Not Found",
        "responseTime": 1575
    },
    {
        "url": "https://google.com",
        "status": 200,
        "statusMessage": "OK",
        "responseTime": 182
    }
]

Limitations

The only possible limitation is that you exceed the size of url parameter. Though if you send a reasonable amount of endpoints, this should not be a problem. There is always an option to have the config on the server and use the configLoader script to load it.

TODO

  1. Expand this into a npm module.
  2. Make more stuff controllable from the config.

uptimechecker's People

Contributors

sebight avatar

Watchers

 avatar

uptimechecker's Issues

Projects old code

Project contains unused code for previous iterations (like endpoint "endpoint1").

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.