Permalink
Browse files

Allow the location of runtime.json to be picked up from environment.

For setups where the code is deployed on a read-only fs.
  • Loading branch information...
1 parent d6b8218 commit 25654b4f70a071551948b1acc3bceacd3388d33c @nsabovic nsabovic committed Sep 25, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/config.js
View
@@ -9,8 +9,9 @@ var Yaml = null, // External libraries are lazy-loaded
var DEFAULT_CLONE_DEPTH = 6,
FILE_WATCHER_INTERVAL = 2500, // For old style (pre-6.0) file watching
DIR = 'NODE_CONFIG_DIR',
- CONFIG_DIR = process.env[DIR] ? process.env[DIR] : process.cwd() + '/config',
- runtimeJsonFilename = CONFIG_DIR + '/runtime.json',
+ CONFIG_DIR = process.env[DIR] || process.cwd() + '/config',
+ RUNTIME = 'NODE_CONFIG_RUNTIME_JSON',
+ runtimeJsonFilename = process.env[RUNTIME] || CONFIG_DIR + '/runtime.json',
originalConfig = null, // Not including the runtime.json values
runtimeJson = {}, // Current runtimeJson extensions
runtimeJsonWatcher = null, // Filesystem watcher for runtime.json

0 comments on commit 25654b4

Please sign in to comment.