feat: add check for vercel deployment
This commit is contained in:
+10
-5
@@ -26,12 +26,17 @@ app.use("/anime", animeRouter);
|
|||||||
app.use(notFoundHandler);
|
app.use(notFoundHandler);
|
||||||
app.use(errorHandler);
|
app.use(errorHandler);
|
||||||
|
|
||||||
app.listen(PORT, () => {
|
if (!Boolean(process?.env?.IS_VERCEL_DEPLOYMENT)) {
|
||||||
|
app.listen(PORT, () => {
|
||||||
console.log(`⚔️ api @ http://localhost:${PORT}`);
|
console.log(`⚔️ api @ http://localhost:${PORT}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
// don't sleep
|
// don't sleep
|
||||||
setInterval(() => {
|
// remove the setInterval below for personal deployments
|
||||||
|
setInterval(() => {
|
||||||
console.log("HEALTHCHECK ;)", new Date().toLocaleString());
|
console.log("HEALTHCHECK ;)", new Date().toLocaleString());
|
||||||
https.get("https://api-aniwatch.onrender.com/health");
|
https.get("https://api-aniwatch.onrender.com/health");
|
||||||
}, 540000);
|
}, 540000);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default app;
|
||||||
|
|||||||
Reference in New Issue
Block a user