My project Bot goes offline in sometime like in 4-5 hours
i need to open project again & again to make project online
Is there any better to run 24/7.
Expose a route and use a third-party service like uptimerobot to send a http request to that end-point, which will keep the project awake.
1 Like
const app = express();
app.get("/", (request, response) => {
console.log(Date.now() + " Ping Received");
response.sendStatus(200);
});
app.listen(process.env.PORT);
setInterval(() => {
http.get(http://${process.env.PROJECT_DOMAIN}.glitch.me/
);
}, 280000);
Like This ?
Yes, but without the setInterval as it’s redundant when using uptimerobot and ineffective because it doesn’t start your project up again if the project is restarted.
1 Like
Ok Thanks For The Help