TwitchFollowers
TwitchFollowers copied to clipboard
Uptimerobot
Please add the option so that we can add it to uptimerobot please
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}`);
})
^^