Permalink
Browse files

custom location for config file

  • Loading branch information...
1 parent a64b149 commit ab3d0ea033601a0a5bafd31f6affe5756f3b26eb @jgallen23 committed Jun 14, 2011
Showing with 10 additions and 3 deletions.
  1. +10 −3 server.js
View
@@ -7,13 +7,20 @@ var port = 80;
var winston = require('winston');
var loggly = require('loggly');
+var configPath;
if (path.existsSync("config.js")) {
- var config = require('./config');
+ configPath = "./config.js";
+} else {
+ configPath = process.env.LOGGLYDASHCONFIG;
+}
+
+var config;
+var initConfig = function(configPath) {
+ config = require(configPath);
for (var subdomain in config) {
config[subdomain].log = loggly.createClient({ subdomain: subdomain, auth: config[subdomain].auth });
}
-}
-
+}(configPath);
var useCache = false;
var cache = {};

0 comments on commit ab3d0ea

Please sign in to comment.