feat: add check for vercel deployment

This commit is contained in:
Ritesh Ghosh
2023-11-29 19:26:08 +05:30
parent 5da81f18ce
commit c079bf808a
+13 -8
View File
@@ -26,12 +26,17 @@ app.use("/anime", animeRouter);
app.use(notFoundHandler);
app.use(errorHandler);
app.listen(PORT, () => {
console.log(`⚔️ api @ http://localhost:${PORT}`);
});
if (!Boolean(process?.env?.IS_VERCEL_DEPLOYMENT)) {
app.listen(PORT, () => {
console.log(`⚔️ api @ http://localhost:${PORT}`);
});
// don't sleep
setInterval(() => {
console.log("HEALTHCHECK ;)", new Date().toLocaleString());
https.get("https://api-aniwatch.onrender.com/health");
}, 540000);
// don't sleep
// remove the setInterval below for personal deployments
setInterval(() => {
console.log("HEALTHCHECK ;)", new Date().toLocaleString());
https.get("https://api-aniwatch.onrender.com/health");
}, 540000);
}
export default app;