You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

24 lines
628 B

import Operation from '../services/operation.js'
import cron from 'node-cron'
const operation = new Operation()
export default function (fastify, opts, done) {
cron.schedule(`00 00 07 * * *`, async () => {
await operation.sanaEnter(fastify.req, fastify.reply)
});
cron.schedule(`00 00 16 * * *`, async () => {
await operation.sanaExit(fastify.req, fastify.reply)
});
cron.schedule(`12 22 * * * *`, async () => {
await operation.test(fastify.req, fastify.reply)
});
fastify.get('/enter', operation.sanaEnter);
fastify.get('/exit', operation.sanaExit);
done();
};