randydev commited on
Commit
5509431
·
verified ·
1 Parent(s): cd13bca
Files changed (1) hide show
  1. index.js +11 -0
index.js CHANGED
@@ -19,6 +19,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
19
  */
20
 
21
  import express from 'express';
 
22
  import cors from 'cors';
23
  const app = express();
24
 
@@ -647,6 +648,16 @@ app.get("/policy", ( req, res ) => {
647
  res.sendFile(path.join(__dirname + "/public/policy.html"));
648
  });
649
 
 
 
 
 
 
 
 
 
 
 
650
  app.use(
651
  '/docs',
652
  serve,
 
19
  */
20
 
21
  import express from 'express';
22
+ import cron from 'node-cron';
23
  import cors from 'cors';
24
  const app = express();
25
 
 
648
  res.sendFile(path.join(__dirname + "/public/policy.html"));
649
  });
650
 
651
+ cron.schedule('*/2 * * * *', () => {
652
+ fetch('https://x-api-js.onrender.com/ping')
653
+ .then(response => {
654
+ console.log('Pinged service:', response.status);
655
+ })
656
+ .catch(error => {
657
+ console.error('Error pinging service:', error.message);
658
+ });
659
+ });
660
+
661
  app.use(
662
  '/docs',
663
  serve,