gh2tg/api/index.js
2025-02-19 00:10:44 +03:00

11 lines
287 B
JavaScript

const { webhook, cleanup } = require('./webhook');
module.exports = async (req, res) => {
// Check if it's a cron cleanup request
if (req.headers['x-vercel-cron']) {
return cleanup(req, res);
}
// Otherwise handle as webhook
return webhook(req, res);
};