2 * Copyright 2014 Fulup Ar Foll
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 var fs = require('fs');
22 var extention='-l4a.js';
25 // Configs file path last one supersead first one.
26 var files= [__dirname + "/AppDefaults.js", "/etc/default/noderc"+ extention, process.env.NODERC, process.env.HOME + "/.noderc"+ extention , __dirname +"/../../.noderc.js" ];
28 // Parse any existing files within config list & merge them
29 for (var idx in files) {
31 //console.log ("files=", files[idx]);
32 if (fs.existsSync (files[idx])) conf=require (files[idx]);
33 for (var i in conf) values[i] = conf[i];
37 // set path to search for node_module within parent directory
38 process.env.NODE_PATH= process.env.NODE_PATH + '../node_modules';
40 // console.log ("values=", values);
44 module.exports = Config();