2020-10-05 13:38:03 +02:00
|
|
|
import {delimiter} from "path";
|
|
|
|
|
2020-09-03 08:28:57 +02:00
|
|
|
// Load config from specified path or default + wms-core/config (default defaults)
|
|
|
|
process.env['NODE_CONFIG_DIR'] =
|
2020-11-03 17:26:32 +01:00
|
|
|
__dirname + '/../../node_modules/wms-core/config/'
|
2020-10-05 13:38:03 +02:00
|
|
|
+ delimiter
|
2020-11-03 17:26:32 +01:00
|
|
|
+ (process.env['NODE_CONFIG_DIR'] || __dirname + '/../../config/');
|
2020-09-03 08:28:57 +02:00
|
|
|
|
2020-11-02 18:17:55 +01:00
|
|
|
import {log} from "wms-core/Logger";
|
2020-06-27 17:20:06 +02:00
|
|
|
import App from "./App";
|
|
|
|
import config from "config";
|
2020-04-23 18:07:55 +02:00
|
|
|
|
|
|
|
(async () => {
|
2020-11-02 18:17:55 +01:00
|
|
|
log.debug('Config path:', process.env['NODE_CONFIG_DIR']);
|
2020-09-03 12:58:07 +02:00
|
|
|
|
2020-10-05 13:38:03 +02:00
|
|
|
const app = new App(config.get<string>('listen_addr'), config.get<number>('port'));
|
2020-04-23 18:07:55 +02:00
|
|
|
await app.start();
|
|
|
|
})().catch(err => {
|
2020-11-02 18:17:55 +01:00
|
|
|
log.error(err);
|
2020-10-05 13:38:03 +02:00
|
|
|
});
|