From be4fc21f1d6c9df66e4aa126f3147c1da5e6e622 Mon Sep 17 00:00:00 2001 From: Evan Yang Date: Wed, 3 Apr 2024 15:41:14 -0700 Subject: [PATCH] update: no longer use bodyparser --- backend/app.js | 5 ++--- backend/package.json | 1 - backend/yarn.lock | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/app.js b/backend/app.js index cf0017064..a7626ce89 100644 --- a/backend/app.js +++ b/backend/app.js @@ -2,7 +2,6 @@ // Load in all of our node modules. Their uses are explained below as they are called. const express = require('express'); -const bodyParser = require('body-parser'); const cron = require('node-cron'); const fetch = require('node-fetch'); const morgan = require('morgan'); @@ -43,8 +42,8 @@ require('assert-env')([ const app = express(); // Required to view Request Body (req.body) in JSON -app.use(bodyParser.json()); -app.use(bodyParser.urlencoded({ extended: true })); +app.use(express.json()); +app.use(express.urlencoded({ extended: true })); // Used to save JWT token from MagicLink app.use(cookieParser()); diff --git a/backend/package.json b/backend/package.json index 5fe900b1b..a19cf8027 100644 --- a/backend/package.json +++ b/backend/package.json @@ -40,7 +40,6 @@ "@slack/bolt": "^2.2.3", "assert-env": "^0.6.0", "async": "^3.2.2", - "body-parser": "^1.19.0", "cookie-parser": "^1.4.5", "cors": "^2.8.5", "dotenv": "^8.2.0", diff --git a/backend/yarn.lock b/backend/yarn.lock index 938ab974a..e1666fa6f 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -1531,7 +1531,7 @@ bluebird@3.5.1: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" integrity sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA== -body-parser@1.19.0, body-parser@^1.19.0: +body-parser@1.19.0: version "1.19.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==