main.ts: fix config path order

This commit is contained in:
Alice Gaudon 2020-09-03 12:58:07 +02:00
parent 5157b12b77
commit 3b124a993b
2 changed files with 5 additions and 3 deletions

View File

@ -9,7 +9,7 @@
"scripts": {
"test": "jest --verbose --runInBand",
"dist-webpack": "webpack --mode production",
"dist": "(test ! -d dist || rm -r dist) && tsc && npm run dist-webpack && mkdir -p dist/core-config && cp -r node_modules/wms-core/config/* dist/core-config/",
"dist": "(test ! -d dist || rm -r dist) && tsc && npm run dist-webpack",
"dev": "concurrently -k -n \"Typescript,Node,Webpack,Maildev\" -p \"[{name}]\" -c \"blue,green,red,yellow\" \"tsc --watch\" \"nodemon\" \"webpack --watch --mode development\" \"maildev\"",
"start": "yarn dist && node dist/main.js"
},

View File

@ -1,14 +1,16 @@
// Load config from specified path or default + wms-core/config (default defaults)
process.env['NODE_CONFIG_DIR'] =
(process.env['NODE_CONFIG_DIR'] || './config/')
__dirname + '/../node_modules/wms-core/config/'
+ require('path').delimiter
+ __dirname + '/core-config/';
+ (process.env['NODE_CONFIG_DIR'] || __dirname + '/../config/');
import Logger from "wms-core/Logger";
import App from "./App";
import config from "config";
(async () => {
Logger.debug('Config path:', process.env['NODE_CONFIG_DIR']);
const app = new App(config.get<number>('port'));
await app.start();
})().catch(err => {