"use strict";
|
import { createConnections } from "typeorm";
|
|
module.exports = app => {
|
app.beforeStart(async () => {
|
// 示例:启动的时候去读取 https://registry.npmjs.com/egg/latest 的版本信息
|
// const result = await app.curl('https://registry.npmjs.com/egg/latest', {
|
// dataType: 'json',
|
// });
|
// app.logger.info('-------------egg latest version------------: %s', result.data.version);
|
|
createConnections()
|
.then(async connection => {
|
let index = 0;
|
for (let item of connection) {
|
console.log(`createConnection success,name${index}:`, item.name);
|
index++;
|
}
|
|
// await app.runSchedule("idcardMobile"); // 手动触发日志
|
})
|
.catch(error => console.log("TypeORM connection error: ", error));
|
});
|
};
|