mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-05 06:37:10 -04:00
move 'debug' routes into own module
This commit is contained in:
parent
8e6b451459
commit
38354f6ae5
2 changed files with 28 additions and 21 deletions
25
node/routes/debug.js
Normal file
25
node/routes/debug.js
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
var formidable = require('formidable');
|
||||||
|
|
||||||
|
module.exports = function(app)
|
||||||
|
{
|
||||||
|
//The Etherpad client side sends information about how a disconnect happen
|
||||||
|
app.post('/ep/pad/connection-diagnostic-info', function(req, res)
|
||||||
|
{
|
||||||
|
new formidable.IncomingForm().parse(req, function(err, fields, files)
|
||||||
|
{
|
||||||
|
console.log("DIAGNOSTIC-INFO: " + fields.diagnosticInfo);
|
||||||
|
res.end("OK");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
//The Etherpad client side sends information about client side javscript errors
|
||||||
|
app.post('/jserror', function(req, res)
|
||||||
|
{
|
||||||
|
new formidable.IncomingForm().parse(req, function(err, fields, files)
|
||||||
|
{
|
||||||
|
console.error("CLIENT SIDE JAVASCRIPT ERROR: " + fields.errorInfo);
|
||||||
|
res.end("OK");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
|
@ -352,27 +352,9 @@ async.waterfall([
|
||||||
apiCaller(req, res, fields)
|
apiCaller(req, res, fields)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//The Etherpad client side sends information about how a disconnect happen
|
require('./routes/debug')(app);
|
||||||
app.post('/ep/pad/connection-diagnostic-info', function(req, res)
|
|
||||||
{
|
|
||||||
new formidable.IncomingForm().parse(req, function(err, fields, files)
|
|
||||||
{
|
|
||||||
console.log("DIAGNOSTIC-INFO: " + fields.diagnosticInfo);
|
|
||||||
res.end("OK");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//The Etherpad client side sends information about client side javscript errors
|
|
||||||
app.post('/jserror', function(req, res)
|
|
||||||
{
|
|
||||||
new formidable.IncomingForm().parse(req, function(err, fields, files)
|
|
||||||
{
|
|
||||||
console.error("CLIENT SIDE JAVASCRIPT ERROR: " + fields.errorInfo);
|
|
||||||
res.end("OK");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//serve index.html under /
|
//serve index.html under /
|
||||||
app.get('/', function(req, res)
|
app.get('/', function(req, res)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue