From eda82a7bf1ac4d27cbafb61709563503a343f3b9 Mon Sep 17 00:00:00 2001 From: andrzej Date: Wed, 29 May 2024 12:18:01 +0200 Subject: [PATCH] switch to json encoding --- dist/index.mjs | 2 +- index.mts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.mjs b/dist/index.mjs index 343a9f2..f9af30c 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -10,7 +10,7 @@ mongoose.connection.on('error', error => console.log(error)); mongoose.Promise = global.Promise; const app = express(); app.use(passport.initialize()); -app.use(bodyParser.urlencoded({ extended: false })); +app.use(bodyParser.json()); app.use("/", routes); app.use('/user', passport.authenticate('jwt', { session: false }), secureRoute); // Handle errors. diff --git a/index.mts b/index.mts index 9f72d71..98905b8 100644 --- a/index.mts +++ b/index.mts @@ -14,7 +14,7 @@ mongoose.Promise = global.Promise; const app = express() app.use(passport.initialize()) -app.use(bodyParser.urlencoded({ extended: false })) +app.use(bodyParser.json()) app.use("/", routes) app.use('/user', passport.authenticate('jwt', { session: false }), secureRoute);