From 6fcfcc550921ab43c00d323c172fd9d04211e53d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 8 Oct 2017 11:18:37 +0200 Subject: 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. --- src/modules/config.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/modules/config.js') diff --git a/src/modules/config.js b/src/modules/config.js index 72d1b1a..5500323 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -4,11 +4,12 @@ const path = require("path"); const TOML = require("toml"); const config = require("configly"); -module.exports = config( - ["./config", path.resolve(__dirname, "../../config/")], - { +function getConfig(configFile = "./config") { + return config(["./config", path.resolve(__dirname, "../../config/")], { parsers: { toml: TOML.parse } - } -); + }); +} + +module.exports = getConfig; -- cgit 1.4.1