From 2ad5a8e03851eeef9ee2af71b8d74befb6e2d55c Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 30 Mar 2020 16:16:00 +0200 Subject: [PATCH] Can load configuration from custom file --- src/main.ts | 6 ++++-- webpack.config.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index cef3d0e..2615768 100644 --- a/src/main.ts +++ b/src/main.ts @@ -17,8 +17,10 @@ console.info("Comunic API v6\t@author Pierre HUBERT\t2019-" + new Date().getFull async function init() { - console.info("Load configuration..."); - ConfigurationHelper.loadConf("config.json"); + const confFile = process.argv.length < 3 ? "config.json" : process.argv[2]; + + console.info("Load configuration from "+confFile+"..."); + ConfigurationHelper.loadConf(confFile); console.info("Connect to database"); await DatabaseHelper.connect(); diff --git a/webpack.config.js b/webpack.config.js index 628b772..0122445 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -35,7 +35,7 @@ module.exports = { // Allow live-reload new WebpackShellPlugin({ - onBuildEnd: ["node_modules/.bin/nodemon build/main.js"] + onBuildEnd: ["node_modules/.bin/nodemon"] }) ],