添加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
back/api/cron.ts Normal file
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);
}
},
);
};

View File

@ -3,6 +3,7 @@ import auth from './auth';
import cookie from './cookie';
import config from './config';
import log from './log';
import cron from './cron';
export default () => {
const app = Router();
@ -10,5 +11,7 @@ export default () => {
cookie(app);
config(app);
log(app);
cron(app);
return app;
};

View File

@ -25,7 +25,7 @@ FROM node:lts-alpine
LABEL maintainer="whyour"
ARG QL_BASE_URL=https://github.com.cnpmjs.org/whyour/qinglong
ARG QL_BASE_BRANCH=master
ARG QL_SCRIPTS_URL=https://github.com.cnpmjs.org/RikudouPatrickstar/jd_scripts
ARG QL_SCRIPTS_URL=https://gitee.com/highdimen/clone_scripts.git
ARG QL_SCRIPTS_BRANCH=master
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
LANG=zh_CN.UTF-8 \