Not letting the App go down

Here’s the solution I provided which should work for any such app that doesn’t actually need any front-facing app (but hey express.js is already installed so why not)

const http = require('http');
const express = require('express');
const app = express();
app.get("/", (request, response) => response.sendStatus(200));
app.listen(process.env.PORT);
setInterval(() => {
  http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 280000);

Should work well enough without the need for any other service. Still testing, though.

3 Likes