Allow config file to be specified Currently via environment variable, but for now that's fine as the only use that I can forsee is for testing, where the plumbing is more important than the interface.
1 file changed, 3 insertions(+), 2 deletions(-)
changed files
M src/index.js → src/index.js
@@ -1,7 +1,8 @@ "use strict"; -const config = require("./modules/config.js"); +const getConfig = require("./modules/config.js"); +const CONFIG_FILE = process.env.CONFIG_FILE || undefined; const PORT = process.env.PORT || config.server.port; const targetDir = process.argv[2];@@ -13,7 +14,7 @@ const app = require("./app.js"); (async function() { try { - (await app()).listen(PORT, () => { + (await app(getConfig(CONFIG_FILE))).listen(PORT, () => { console.log(`App listening on port ${PORT}`); }); } catch (error) {