diff options
author | Peter 'Pita' Martischka <petermartischka@googlemail.com> | 2012-10-27 17:05:26 +0100 |
---|---|---|
committer | Peter 'Pita' Martischka <petermartischka@googlemail.com> | 2012-10-27 17:05:26 +0100 |
commit | cac27c864a394ba7a6ce0cf6bf1e3f625c6a3d49 (patch) | |
tree | 44e5b44b76de27a11c69fe8c89953b5a4e87d0e7 /src/node/hooks/express | |
parent | cc7ddddd2f130d1ab3487c0b1713897cb339dc5d (diff) | |
download | etherpad-lite-cac27c864a394ba7a6ce0cf6bf1e3f625c6a3d49.zip |
load list of spec files from the server
Diffstat (limited to 'src/node/hooks/express')
-rw-r--r-- | src/node/hooks/express/tests.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/node/hooks/express/tests.js b/src/node/hooks/express/tests.js index ebc6d7f8..793fcfd8 100644 --- a/src/node/hooks/express/tests.js +++ b/src/node/hooks/express/tests.js @@ -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/'); - }); + }); }
\ No newline at end of file |