etherpad-lite/src/node/hooks/express/tests.js

15 lines
427 B
JavaScript
Raw Normal View History

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"
}
var filePath = path.normalize(__dirname + "/../../../../tests/frontend/")
filePath += subPath.replace("..", "");
res.sendfile(filePath);
});
}