From be6cdceeea908e369d34a4d37b3cce3bb3392dfa Mon Sep 17 00:00:00 2001 From: Jane Petrovna Date: Sun, 6 Jun 2021 01:20:06 -0400 Subject: [PATCH] help me --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index fffd857..b56c3f6 100644 --- a/index.js +++ b/index.js @@ -59,7 +59,7 @@ app.get("/indexes/:project(\\w+)", (req, res) => { } }); -app.use("/updates", express.text()); +app.use(express.text()); function diff(current, checked) { let lines_current = current.split('\n').map(l => l.trim()).filter(l => l != ""); @@ -114,7 +114,7 @@ function diff(current, checked) { app.post("/updates/:project(\\w+)", (req, res) => { let project_id = req.params['project']; - const body = (typeof req.body == "string") ? req.body : ""; + const body = req.body != undefined ? req.body : ""; console.log(`${req.body}, ${typeof req.body}`); console.log(`${body}`); let adjustedBody = body.replace(/\r/, "");