diff --git a/backend/index.js b/backend/index.js index d189459f..0f6a1d45 100644 --- a/backend/index.js +++ b/backend/index.js @@ -23,7 +23,6 @@ const server = require('http').createServer(app) app.listen(3100, () => { logger.info('Grappa app listening on port 3100!') - logger.info('Debugging version: 0.0.5') logger.info(`Environment is ${process.env.NODE_ENV}`) }) diff --git a/backend/package.json b/backend/package.json old mode 100755 new mode 100644 diff --git a/backend/src/middleware/attachments.js b/backend/src/middleware/attachments.js index b8bc9649..a80e2014 100644 --- a/backend/src/middleware/attachments.js +++ b/backend/src/middleware/attachments.js @@ -18,19 +18,11 @@ const storage = () => { } } -const upload = () => { - console.log("Starting upload") - try { - multer({ storage: storage() }).fields([ +const upload = multer({ storage: storage() }).fields([ { name: 'otherFile' }, { name: 'reviewFile', maxCount: 1 }, { name: 'thesisFile', maxCount: 1 } ]) - } catch (e) { - console.log("Upload failed. Error: ") - console.log(e) - throw e - } -} + module.exports = upload diff --git a/backend/src/middleware/auditLogger.js b/backend/src/middleware/auditLogger.js index 343a2913..fd8fd011 100644 --- a/backend/src/middleware/auditLogger.js +++ b/backend/src/middleware/auditLogger.js @@ -5,7 +5,7 @@ const loggedMethods = ['POST', 'PUT', 'DELETE'] module.exports = function auditLogger(req, res, next) { console.log("Req: " + req.method + " " + req.originalUrl + " at " + new Date().toString()) - if (req.body) console.log("body keys: " + Object.keys(req.body)) + if (req.headers && req.headers.uid) console.log("Uid: " + req.headers.uid) if (loggedMethods.includes(req.method)) { const type = `${req.method} ${req.originalUrl}` diff --git a/backend/src/routes/theses.js b/backend/src/routes/theses.js index 07d4107a..65cf5cf7 100644 --- a/backend/src/routes/theses.js +++ b/backend/src/routes/theses.js @@ -74,7 +74,10 @@ router.put('/', jsonParser, auth.checkStaff, (req, res, next) => thesisControlle * @apiSuccess thesis New thesis * @apiSuccess roles New roles */ -router.post('/', attachment, auth.checkStaff, (req, res, next) => thesisController.saveThesisForm(req, res).catch(next)) +router.post('/', attachment, auth.checkStaff, (req, res, next) => { + console.log("Starting route post thesis :") + return thesisController.saveThesisForm(req, res).catch(next) +}) /** * @api {put} theses/printed Mark theses as printed diff --git a/backend/src/util/ethesis.js b/backend/src/util/ethesis.js old mode 100755 new mode 100644