@ccci/micro-server 0.0.18 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -78109,14 +78109,13 @@ class DatabaseConnector {
|
|
|
78109
78109
|
static rootDir;
|
|
78110
78110
|
constructor(path) {
|
|
78111
78111
|
DatabaseConnector.rootDir = path;
|
|
78112
|
-
console.log("DatabaseConnector.rootDir :>> ", DatabaseConnector.rootDir);
|
|
78113
78112
|
}
|
|
78114
78113
|
static async init() {
|
|
78115
78114
|
DatabaseConnector.connections = [];
|
|
78116
78115
|
let connections = [];
|
|
78117
78116
|
const configPath = `${DatabaseConnector.rootDir}/config/config.json`;
|
|
78118
|
-
const configFile =
|
|
78119
|
-
const configs = await
|
|
78117
|
+
const configFile = fs.readFileSync(configPath, "utf8");
|
|
78118
|
+
const configs = await JSON.parse(configFile);
|
|
78120
78119
|
const config = configs[env];
|
|
78121
78120
|
const connection = new Sequelize(config);
|
|
78122
78121
|
DatabaseConnector.connection = connection;
|