test cronjob

This commit is contained in:
Bright 2024-02-07 11:45:55 +07:00
parent 551d2d70a4
commit 3d7c7baacb
3 changed files with 35 additions and 0 deletions

View file

@ -4,10 +4,12 @@ import cors from "cors";
import express from "express";
import swaggerUi from "swagger-ui-express";
import swaggerDocument from "./swagger.json";
import * as cron from 'node-cron';
import error from "./middlewares/error";
import { AppDataSource } from "./database/data-source";
import { RegisterRoutes } from "./routes";
async function main() {
await AppDataSource.initialize();
@ -28,6 +30,10 @@ async function main() {
app.use(error);
const APP_HOST = process.env.APP_HOST || "0.0.0.0";
const APP_PORT = +(process.env.APP_PORT || 3000);
// cron.schedule('*/10 * * * * *', () => {
// console.log("cron job....")
// });
// app.listen(APP_PORT, APP_HOST, () => console.log(`Listening on: http://localhost:${APP_PORT}`));
app.listen(