summaryrefslogtreecommitdiff
path: root/js/bin/HttpServer.js
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2015-05-28 18:24:36 +0200
committerJose <jose@zeroc.com>2015-05-28 18:24:36 +0200
commit300e978385a3754e21e4bdfe40f4e9c9f63919b8 (patch)
treec09a07a127eece2bb1e6c045a7166bba88ef9ff7 /js/bin/HttpServer.js
parentFixed issue on Android where network operation could occur on main thread (IC... (diff)
downloadice-300e978385a3754e21e4bdfe40f4e9c9f63919b8.tar.bz2
ice-300e978385a3754e21e4bdfe40f4e9c9f63919b8.tar.xz
ice-300e978385a3754e21e4bdfe40f4e9c9f63919b8.zip
Fix HttpServer.js location of JS libraries
Diffstat (limited to 'js/bin/HttpServer.js')
-rw-r--r--js/bin/HttpServer.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/js/bin/HttpServer.js b/js/bin/HttpServer.js
index a8e28dd6d84..102b0d909ad 100644
--- a/js/bin/HttpServer.js
+++ b/js/bin/HttpServer.js
@@ -37,12 +37,6 @@ function Init()
js: "text/javascript",
};
- var demoDist = !isdir(path.join(__dirname, "..", "lib"));
-
- //
- // If using a demo distribution or USE_BIN_DIST was set,
- // resolve libraries in bower_components/zeroc-icejs directory.
- //
var libraries = ["/lib/Ice.js", "/lib/Ice.min.js",
"/lib/Glacier2.js", "/lib/Glacier2.min.js",
"/lib/IceStorm.js", "/lib/IceStorm.min.js",
@@ -67,10 +61,11 @@ function Init()
var iceLib = libraries.indexOf(req.url.pathname) !== -1;
var iceLibMap = libraryMaps.indexOf(req.url.pathname) !== -1;
- //
- // If ICE_HOME has been set resolve Ice libraries paths into ICE_HOME.
- //
- filePath = path.resolve(path.join(this._basePath, req.url.pathname));
+
+ var basePath = (process.env.USE_BIN_DIST == "yes" && (iceLib || iceLibMap)) ?
+ path.resolve(path.join(require.resolve("ice"), "..", "..")) : this._basePath;
+
+ filePath = path.resolve(path.join(basePath, req.url.pathname));
//
// If OPTIMIZE is set resolve Ice libraries to the corresponding minified