File size: 657 Bytes
15fe565 75396ac 15fe565 97f794f 15fe565 75396ac 97f794f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import express from 'express';
import { randomBytes } from "crypto";
import cron from 'node-cron';
const app = express();
const port = 7860
app.post('/webhook', (req, res) => {
console.log('Received webhook:', req.body);
res.status(200).send('Webhook received');
});
cron.schedule('*/2 * * * *', () => {
fetch('https://docs-api.dev.ryzenths.dpdns.org/runtime')
.then(response => {
console.log('Pinged service:', response.status);
})
.catch(error => {
console.error('Error pinging service:', error.message);
});
});
app.listen(port, "0.0.0.0", () => {
console.log(`Server running on http://localhost:${port}`);
}); |