mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 17:36:14 -04:00
load list of spec files from the server
This commit is contained in:
parent
cc7ddddd2f
commit
cac27c864a
3 changed files with 18 additions and 10 deletions
|
@ -1,6 +1,15 @@
|
|||
var path = require("path");
|
||||
var fs = require("fs");
|
||||
|
||||
exports.expressCreateServer = function (hook_name, args, cb) {
|
||||
args.app.get('/tests/frontend/specs_list.js', function(req, res){
|
||||
fs.readdir('tests/frontend/specs', function(err, files){
|
||||
if(err){ return res.send(500); }
|
||||
|
||||
res.send("var specs_list = " + JSON.stringify(files.sort()) + ";\n");
|
||||
});
|
||||
});
|
||||
|
||||
args.app.get('/tests/frontend/*', function (req, res) {
|
||||
var subPath = req.url.substr("/tests/frontend".length);
|
||||
if (subPath == ""){
|
||||
|
@ -16,5 +25,5 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
|||
|
||||
args.app.get('/tests/frontend', function (req, res) {
|
||||
res.redirect('/tests/frontend/');
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue