diff options
author | Alan Pearce | 2017-10-08 11:18:37 +0200 |
---|---|---|
committer | Alan Pearce | 2017-10-08 11:18:37 +0200 |
commit | 6fcfcc550921ab43c00d323c172fd9d04211e53d (patch) | |
tree | 2220ab31af63a406f9c4f947e014b022408bf985 /src/index.js | |
parent | 529946dc5bdccc2153c97e2040953047319480f4 (diff) | |
download | homestead-2017.tar.lz homestead-2017.tar.zst homestead-2017.zip |
Allow config file to be specified 2017
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.
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/index.js b/src/index.js index b7bc1a3..a9ce7f7 100644 --- a/src/index.js +++ b/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) { |