An Express middleware that keeps your Glitch project alive.
Inspired by koa-glitch-keepalive.
npm i --save express express-glitch-keepalive
const express = require('express');
const keepalive = require('express-glitch-keepalive');
const app = express();
app.use(keepalive);
app.get('/', (req, res) => {
res.json('Ok');
});
Keepalive can be configured in a number of ways:
- The request path to use defaults to
/_keepalive
but can be changed with the environment variableKEEPALIVE_PATH
. - The delay between keepalive requests defaults to 3 minutes but can be changed with the environment variable
KEEPALIVE_MINUTES
.