21 lines
619 B
TypeScript
21 lines
619 B
TypeScript
import {delimiter} from "path";
|
|
|
|
// Load config from specified path or default + swaf/config (default defaults)
|
|
process.env['NODE_CONFIG_DIR'] =
|
|
__dirname + '/../node_modules/swaf/config/'
|
|
+ delimiter
|
|
+ (process.env['NODE_CONFIG_DIR'] || __dirname + '/../config/');
|
|
|
|
import {logger} from "./Logger";
|
|
import TestApp from "./TestApp";
|
|
import config from "config";
|
|
|
|
(async () => {
|
|
logger.debug('Config path:', process.env['NODE_CONFIG_DIR']);
|
|
|
|
const app = new TestApp(config.get<string>('listen_addr'), config.get<number>('port'));
|
|
await app.start();
|
|
})().catch(err => {
|
|
logger.error(err);
|
|
});
|