diff --git a/lib/helpers.js b/lib/helpers.js index e532ffd..e9fb7bc 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -19,7 +19,7 @@ module.exports = function(config){ }, parseJSON: function(str) { - var scopePath = path.join("/", scope) + var scopePath = "/" + scope; var rx = RegExp("^" + scopePath, "i") try { @@ -71,7 +71,7 @@ module.exports = function(config){ scopedPath: function(fpath){ if(scope){ - var rx = RegExp("^" + path.join("/", scope)) + var rx = RegExp("^" + "/" + scope) return fpath.replace(rx, "") }else{ return fpath @@ -79,7 +79,7 @@ module.exports = function(config){ }, filePath: function(fpath){ - return path.join(config.scope, fpath) + return config.scope + '/' + fpath; }, /** @@ -120,13 +120,13 @@ module.exports = function(config){ var filepath = obj.path ? qs.escape(obj.path) : "" // build full path - var fullpath = path.join(obj.hostname) - fullpath = path.join(fullpath, obj.version || "1") - fullpath = path.join(fullpath, obj.action) - fullpath = path.join(fullpath, rootpath) - fullpath = path.join(fullpath, scopepath) - fullpath = path.join(fullpath, filepath) - + var fullpath = obj.hostname; + fullpath += '/' + (obj.version || "1"); + fullpath += '/' + obj.action; + fullpath += '/' + rootpath; + fullpath += '/' + scopepath; + fullpath += filepath; + // add protocol var fullurl = "https://" + fullpath