From c45a0edd602de7ee06f17db809c4abbfff0c6719 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Tue, 13 Oct 2015 10:49:44 -0400 Subject: [PATCH 1/3] Added ability to configure HTTP route prefixes. --- bitcore-node/index.js | 19 +++++++++++++++---- public/views/includes/header.html | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/bitcore-node/index.js b/bitcore-node/index.js index a9bfa70..d5598f3 100644 --- a/bitcore-node/index.js +++ b/bitcore-node/index.js @@ -6,6 +6,13 @@ var fs = require('fs'); var InsightUI = function(options) { BaseService.call(this, options); + this.routePrefix = options.routePrefix; + if (typeof options.apiPrefix !== 'undefined') { + this.apiPrefix = options.apiPrefix; + } else { + this.apiPrefix = 'insight-api'; + } + }; InsightUI.dependencies = ['insight-api']; @@ -18,7 +25,11 @@ InsightUI.prototype.start = function(callback) { }; InsightUI.prototype.getRoutePrefix = function() { - return 'insight'; + if (typeof this.routePrefix !== 'undefined') { + return this.routePrefix; + } else { + return 'insight'; + } }; InsightUI.prototype.setupRoutes = function(app, express) { @@ -38,9 +49,9 @@ InsightUI.prototype.setupRoutes = function(app, express) { InsightUI.prototype.filterIndexHTML = function(data) { var transformed = data - .replace(/ - insight + insight