添加Cron接口,更新Dockerfile

This commit is contained in:
whyour
2021-03-27 21:18:44 +08:00
parent 7ba3e59980
commit 1d585e2619
3 changed files with 25 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
import { Router, Request, Response, NextFunction } from 'express';
import { Container } from 'typedi';
import { Logger } from 'winston';
import * as fs from 'fs';
import config from '../config';
const route = Router();
export default (app: Router) => {
app.use('/', route);
route.get(
'/cron',
async (req: Request, res: Response, next: NextFunction) => {
const logger: Logger = Container.get('logger');
try {
} catch (e) {
logger.error('🔥 error: %o', e);
return next(e);
}
},
);
};