Skip to content

Commit

Permalink
Add in separate config reader, nicer for no.de.
Browse files Browse the repository at this point in the history
  • Loading branch information
roidrage committed Mar 12, 2011
1 parent d988ade commit 8b5598c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions config/config.js
@@ -0,0 +1,11 @@
var fs = require('fs');
var configFile = {};

if (process.env['RIAK_CONFIG'] != null) {
configFile = process.env['RIAK_CONFIG'];
} else {
configFile = __dirname + "/riak.js";
}

var config = require(configFile);
module.exports = config;
2 changes: 1 addition & 1 deletion lib/syslog-server.js
@@ -1,5 +1,5 @@
// Require needed libraries and config
var config = require("../config/riak.js"),
var config = require("../config/config.js"),
syslogParser = require('glossy').Parse,
dgram = require('dgram'),
riak = require('riak-js'),
Expand Down
2 changes: 1 addition & 1 deletion lib/web/server.js
@@ -1,6 +1,6 @@
var express = require('express'),
connect = require('connect'),
config = require("../../config/riak.js"),
config = require("../../config/config.js"),
riak = require('riak-js').getClient(config);

var app = express.createServer();
Expand Down

0 comments on commit 8b5598c

Please sign in to comment.