TwitchFollowers icon indicating copy to clipboard operation
TwitchFollowers copied to clipboard

Uptimerobot

Open Masonisbetter6 opened this issue 3 years ago • 1 comments

Please add the option so that we can add it to uptimerobot please

Masonisbetter6 avatar Dec 14 '21 23:12 Masonisbetter6

Create a mini API an give to it a port to listen to, you can use express to create the mini API.

Here's an example.

const express = require('express')
const app = express()
 
app.get('/', function (req, res) {
  res.send('Hello World')
})
 
app.listen(3000)

Or you can also create an API with http with this module you don't need to download anything(it comes with nodejs)

const http = require('http');

const port = 3000;

const server = http.createServer((req, res) => {
    if (req.method !== 'GET') {
        return res.end(`{"error": "${http.STATUS_CODES[405]}"}`);
    }
     if (req.url === '/') {
       return res.end(`<h1>Hello World</h1>`);
    }
    return res.end(`{"error": "${http.STATUS_CODES[404]}"}`);
})

server.listen(port, () => {
    console.log(`Server listening on port ${port}`);
})

chikof avatar Dec 16 '21 13:12 chikof

^^

xxerick avatar Apr 06 '23 15:04 xxerick