From 7ec3124d82bc377a48a2dff5b84c52fd059e4508 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Tue, 13 Oct 2015 11:16:12 -0400 Subject: [PATCH] Fix bug with trailing `/`. --- bitcore-node/index.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/bitcore-node/index.js b/bitcore-node/index.js index d5598f3..a88b350 100644 --- a/bitcore-node/index.js +++ b/bitcore-node/index.js @@ -12,7 +12,11 @@ var InsightUI = function(options) { } else { this.apiPrefix = 'insight-api'; } - + if (typeof options.routePrefix !== 'undefined') { + this.routePrefix = options.routePrefix; + } else { + this.routePrefix = 'insight'; + } }; InsightUI.dependencies = ['insight-api']; @@ -25,11 +29,7 @@ InsightUI.prototype.start = function(callback) { }; InsightUI.prototype.getRoutePrefix = function() { - if (typeof this.routePrefix !== 'undefined') { - return this.routePrefix; - } else { - return 'insight'; - } + return this.routePrefix; }; InsightUI.prototype.setupRoutes = function(app, express) { @@ -49,8 +49,12 @@ InsightUI.prototype.setupRoutes = function(app, express) { InsightUI.prototype.filterIndexHTML = function(data) { var transformed = data - .replace(/