mirror of
https://github.com/taniarascia/takenote.git
synced 2026-05-26 13:51:16 +00:00
Use Inbuilt body-parser (#486)
* Remove bodyParser import Express comes with its own version of body-parser, so we don't need to import it separately. * Updated code to use inbuild body-parser Co-authored-by: Tania Rascia <taniarascia@gmail.com>
This commit is contained in:
@@ -2,7 +2,6 @@ import path from 'path'
|
||||
|
||||
import express, { Router } from 'express'
|
||||
import cookieParser from 'cookie-parser'
|
||||
import bodyParser from 'body-parser'
|
||||
import cors from 'cors'
|
||||
import helmet from 'helmet'
|
||||
import compression from 'compression'
|
||||
@@ -13,8 +12,7 @@ export default function initializeServer(router: Router) {
|
||||
const origin = { origin: isProduction ? false : '*' }
|
||||
|
||||
app.set('trust proxy', 1)
|
||||
app.use(bodyParser.urlencoded({ extended: false }))
|
||||
app.use(bodyParser.json())
|
||||
app.use(express.json())
|
||||
app.use(cookieParser())
|
||||
app.use(cors(origin))
|
||||
app.use(helmet())
|
||||
|
||||
Reference in New Issue
Block a user