From 7adcd3a3c0054afe61b1e16db581f57147659d1b Mon Sep 17 00:00:00 2001 From: Riku Rouvila Date: Tue, 24 Nov 2015 20:36:48 +0200 Subject: [PATCH] make config.json file optional --- lib/config.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/config.js b/lib/config.js index 0675bdf..62775e9 100644 --- a/lib/config.js +++ b/lib/config.js @@ -1,7 +1,14 @@ 'use strict'; var _ = require('lodash'); -var config = require('../config.json'); +var config = {}; + +try { + config = require('../config.json'); +} catch(e) { + console.log('Couldn\'t read config.json file'); +} + var env = process.env.NODE_ENV || 'development'; // TWITTER_CONSUMER_KEY => twitter.consumerKey