2019-09-28 16:12:42 +08:00

21 lines
517 B
TypeScript

import * as moment from 'moment';
export default app => {
const ctx = app.createAnonymousContext();
app.beforeStart(async () => {
ctx.logger.info('beforeStart');
// 格式化时间
Date.prototype.toJSON = function () {
return moment(this).format('YYYY-MM-DD HH:mm:ss');
};
});
app.ready(async () => {
ctx.logger.info('=====service start succeed=====');
});
app.beforeClose(async () => {
ctx.logger.info('beforeClose');
});
};