main.ts: fix config path order
This commit is contained in:
parent
5157b12b77
commit
3b124a993b
@ -9,7 +9,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest --verbose --runInBand",
|
"test": "jest --verbose --runInBand",
|
||||||
"dist-webpack": "webpack --mode production",
|
"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\"",
|
"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"
|
"start": "yarn dist && node dist/main.js"
|
||||||
},
|
},
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
// Load config from specified path or default + wms-core/config (default defaults)
|
// Load config from specified path or default + wms-core/config (default defaults)
|
||||||
process.env['NODE_CONFIG_DIR'] =
|
process.env['NODE_CONFIG_DIR'] =
|
||||||
(process.env['NODE_CONFIG_DIR'] || './config/')
|
__dirname + '/../node_modules/wms-core/config/'
|
||||||
+ require('path').delimiter
|
+ require('path').delimiter
|
||||||
+ __dirname + '/core-config/';
|
+ (process.env['NODE_CONFIG_DIR'] || __dirname + '/../config/');
|
||||||
|
|
||||||
import Logger from "wms-core/Logger";
|
import Logger from "wms-core/Logger";
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
import config from "config";
|
import config from "config";
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
|
Logger.debug('Config path:', process.env['NODE_CONFIG_DIR']);
|
||||||
|
|
||||||
const app = new App(config.get<number>('port'));
|
const app = new App(config.get<number>('port'));
|
||||||
await app.start();
|
await app.start();
|
||||||
})().catch(err => {
|
})().catch(err => {
|
||||||
|
Loading…
Reference in New Issue
Block a user