summary refs log tree commit diff stats
path: root/src/modules/config.js
diff options
context:
space:
mode:
authorAlan Pearce2017-10-08 11:18:37 +0200
committerAlan Pearce2017-10-08 11:18:37 +0200
commit6fcfcc550921ab43c00d323c172fd9d04211e53d (patch)
tree2220ab31af63a406f9c4f947e014b022408bf985 /src/modules/config.js
parent529946dc5bdccc2153c97e2040953047319480f4 (diff)
downloadhomestead-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/modules/config.js')
-rw-r--r--src/modules/config.js11
1 files changed, 6 insertions, 5 deletions
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;