mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 22:23:33 +01:00
lint: src/node/hooks/express/apicalls.js
This commit is contained in:
parent
fbc70c1276
commit
4de2844af2
1 changed files with 5 additions and 2 deletions
|
@ -1,9 +1,11 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
const log4js = require('log4js');
|
const log4js = require('log4js');
|
||||||
const clientLogger = log4js.getLogger('client');
|
const clientLogger = log4js.getLogger('client');
|
||||||
const formidable = require('formidable');
|
const formidable = require('formidable');
|
||||||
const apiHandler = require('../../handler/APIHandler');
|
const apiHandler = require('../../handler/APIHandler');
|
||||||
|
|
||||||
exports.expressCreateServer = function (hook_name, args, cb) {
|
exports.expressCreateServer = (hookName, args, cb) => {
|
||||||
// The Etherpad client side sends information about how a disconnect happened
|
// The Etherpad client side sends information about how a disconnect happened
|
||||||
args.app.post('/ep/pad/connection-diagnostic-info', (req, res) => {
|
args.app.post('/ep/pad/connection-diagnostic-info', (req, res) => {
|
||||||
new formidable.IncomingForm().parse(req, (err, fields, files) => {
|
new formidable.IncomingForm().parse(req, (err, fields, files) => {
|
||||||
|
@ -15,8 +17,9 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
||||||
// The Etherpad client side sends information about client side javscript errors
|
// The Etherpad client side sends information about client side javscript errors
|
||||||
args.app.post('/jserror', (req, res) => {
|
args.app.post('/jserror', (req, res) => {
|
||||||
new formidable.IncomingForm().parse(req, (err, fields, files) => {
|
new formidable.IncomingForm().parse(req, (err, fields, files) => {
|
||||||
|
let data;
|
||||||
try {
|
try {
|
||||||
var data = JSON.parse(fields.errorInfo);
|
data = JSON.parse(fields.errorInfo);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return res.end();
|
return res.end();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue