From 5aa147a37338c422a7e8ed941aa77cb39fc2a398 Mon Sep 17 00:00:00 2001 From: Jane Petrovna Date: Sun, 6 Jun 2021 02:15:21 -0400 Subject: [PATCH] this is hurting my brain --- index.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 2256d63..a058388 100644 --- a/index.js +++ b/index.js @@ -58,10 +58,6 @@ app.get("/indexes/:project(\\w+)", (req, res) => { res.sendStatus(404); } }); -app.use((req, res, next) => { - console.log(req); - next(); -}) app.use(express.urlencoded({ extended: false })); function diff(current, checked) { @@ -117,8 +113,8 @@ function diff(current, checked) { app.post("/updates/:project(\\w+)", (req, res) => { let project_id = req.params['project']; - const body = req.rawBody || ""; - console.log(req.rawBody); + const body = String(Object.keys(req.body)[0]); + console.log(req.body); console.log(`${req.body}, ${typeof req.body}`); console.log(`${body}`); let adjustedBody = body.replace(/\r/, "");