From abec07b1f9ae7bf660146cf3d21949788b5889b2 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Mon, 28 Aug 2017 11:21:01 +0200 Subject: [PATCH] If config.js is missing, fallback to config.example.js which is in the git repo --- server.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index faab366f6..baf9b2e99 100644 --- a/server.js +++ b/server.js @@ -10,7 +10,13 @@ var NetfluxSrv = require('./node_modules/chainpad-server/NetfluxWebsocketSrv'); var Package = require('./package.json'); var Path = require("path"); -var config = require('./config'); +var config; +try { + config = require('./config'); +} catch (e) { + console.log("You can customize the configuration by copying config.example.js to config.js"); + config = require('./config.example'); +} var websocketPort = config.websocketPort || config.httpPort; var useSecureWebsockets = config.useSecureWebsockets || false;