diff --git a/lib/index.js b/lib/index.js index 870ca85..fa93386 100644 --- a/lib/index.js +++ b/lib/index.js @@ -25,7 +25,11 @@ var InsightAPI = function(options) { inv: [] }; - this.routePrefix = options.routePrefix; + if (!_.isUndefined(options.routePrefix)) { + this.routePrefix = options.routePrefix; + } else { + this.routePrefix = this.name; + } this.txController = new TxController(this.node); }; @@ -35,11 +39,7 @@ InsightAPI.dependencies = ['address', 'web']; inherits(InsightAPI, BaseService); InsightAPI.prototype.getRoutePrefix = function() { - if (!_.isUndefined(this.routePrefix)) { - return this.routePrefix; - } else { - return this.name; - } + return this.routePrefix; }; InsightAPI.prototype.start = function(callback) {