diff options
author | Joe George <joe@zeroc.com> | 2015-06-01 14:49:05 -0400 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2015-06-01 15:23:28 -0400 |
commit | beeb6e2890bafb8a6efac64d069e6a6231527105 (patch) | |
tree | f05de89e160fe8d082c09856fb3c4034fd1131d3 /js/bin/HttpServer.js | |
parent | Fixed test env for PHP brew and Java on Windows (diff) | |
download | ice-beeb6e2890bafb8a6efac64d069e6a6231527105.tar.bz2 ice-beeb6e2890bafb8a6efac64d069e6a6231527105.tar.xz ice-beeb6e2890bafb8a6efac64d069e6a6231527105.zip |
Fix ICE-6549
- Remove js/index.js
- Remove demo npm command
- Redirect / to frist test in js browser tests
Diffstat (limited to 'js/bin/HttpServer.js')
-rw-r--r-- | js/bin/HttpServer.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/js/bin/HttpServer.js b/js/bin/HttpServer.js index fb205988db5..5a7239e2cb8 100644 --- a/js/bin/HttpServer.js +++ b/js/bin/HttpServer.js @@ -58,8 +58,8 @@ function Init() { var iceLib = libraries.indexOf(req.url.pathname) !== -1; var iceLibMap = libraryMaps.indexOf(req.url.pathname) !== -1; - - var basePath = (process.env.USE_BIN_DIST == "yes" && (iceLib || iceLibMap)) ? + + var basePath = (process.env.USE_BIN_DIST == "yes" && (iceLib || iceLibMap)) ? path.resolve(path.join(require.resolve("ice"), "..", "..")) : this._basePath; var filePath = path.resolve(path.join(basePath, req.url.pathname)); @@ -134,7 +134,17 @@ function Init() } else { - if(!stats.isFile()) + if(req.url.pathname === '/') + { + res.writeHead(302, + { + "Location": "test/Ice/acm/index.html" + }); + res.end(); + console.log("HTTP/302 (Found) " + req.method + " " + req.url.pathname + " -> " + + "test/Ice/acm/index.html"); + } + else if(!stats.isFile()) { res.writeHead(403); res.end("403 Forbiden"); |