2012-10-02 01:35:43 +02:00
|
|
|
var path = require("path");
|
|
|
|
|
|
|
|
exports.expressCreateServer = function (hook_name, args, cb) {
|
|
|
|
args.app.get('/tests/frontend/*', function (req, res) {
|
|
|
|
var subPath = req.url.substr("/tests/frontend".length);
|
|
|
|
if (subPath == ""){
|
|
|
|
subPath = "index.html"
|
|
|
|
}
|
2012-10-08 00:34:29 +02:00
|
|
|
subPath = subPath.split("?")[0];
|
2012-10-02 01:35:43 +02:00
|
|
|
|
|
|
|
var filePath = path.normalize(__dirname + "/../../../../tests/frontend/")
|
|
|
|
filePath += subPath.replace("..", "");
|
|
|
|
|
|
|
|
res.sendfile(filePath);
|
|
|
|
});
|
2012-10-27 17:41:17 +02:00
|
|
|
|
|
|
|
args.app.get('/tests/frontend', function (req, res) {
|
|
|
|
res.redirect('/tests/frontend/');
|
|
|
|
});
|
2012-10-02 01:35:43 +02:00
|
|
|
}
|