我使用具有路由器的节点js创建了api。但是我想在cron作业代码中调用路由器动作功能。
const create = async function (req, res) {
}
module.exports.create = create;
cron.schedule('1 * * * *', function () {
// I want to call create inside the cron code.
console.log('running a task');
});