From 4994387c32bb4979554d65f75b62f3ee24bf71bd Mon Sep 17 00:00:00 2001 From: Lennart kats Date: Wed, 17 Jun 2015 10:14:53 +0000 Subject: [PATCH] Allow /profile as baseUrl --- server.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server.js b/server.js index a0c1c61d..28bf586a 100755 --- a/server.js +++ b/server.js @@ -174,7 +174,6 @@ function start(configName, options, callback) { }); } -function replaceDomain(uri, domain) { - var parsed = url.parse(uri); - return url.format(parsed); -} +function replaceDomain(url, domain) { + return url.replace(/[^./]+\.[^./]+$/, domain).replace(/[^./]+\.[^.]+\//, domain + "/"); +} \ No newline at end of file