2020-11-11 18:59:38 +01:00
|
|
|
import {delimiter} from "path";
|
|
|
|
|
2020-11-12 16:11:16 +01:00
|
|
|
// Load config from specified path or default + swaf/config (default defaults)
|
2020-11-11 18:59:38 +01:00
|
|
|
process.env['NODE_CONFIG_DIR'] =
|
2021-01-25 12:37:41 +01:00
|
|
|
__dirname + '/../node_modules/swaf/config/'
|
2020-11-11 18:59:38 +01:00
|
|
|
+ delimiter
|
2021-01-25 12:37:41 +01:00
|
|
|
+ (process.env['NODE_CONFIG_DIR'] || __dirname + '/../config/');
|
2020-11-11 18:59:38 +01:00
|
|
|
|
2021-01-22 15:54:26 +01:00
|
|
|
import {logger} from "./Logger";
|
2020-11-11 18:59:38 +01:00
|
|
|
import TestApp from "./TestApp";
|
|
|
|
import config from "config";
|
|
|
|
|
|
|
|
(async () => {
|
2021-01-22 15:54:26 +01:00
|
|
|
logger.debug('Config path:', process.env['NODE_CONFIG_DIR']);
|
2020-11-11 18:59:38 +01:00
|
|
|
|
|
|
|
const app = new TestApp(config.get<string>('listen_addr'), config.get<number>('port'));
|
|
|
|
await app.start();
|
|
|
|
})().catch(err => {
|
2021-01-22 15:54:26 +01:00
|
|
|
logger.error(err);
|
2020-11-11 18:59:38 +01:00
|
|
|
});
|