diff --git a/package-lock.json b/package-lock.json index 3d8516f..331dbc8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "dependencies": { "@types/express": "^5.0.6", "@types/node": "^25.6.0", + "body-parser": "^2.2.2", "express": "^5.2.1", "tsc-alias": "^1.8.16", "typescript": "^6.0.3" diff --git a/package.json b/package.json index fb232ef..674014b 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "dependencies": { "@types/express": "^5.0.6", "@types/node": "^25.6.0", + "body-parser": "^2.2.2", "express": "^5.2.1", "tsc-alias": "^1.8.16", "typescript": "^6.0.3" diff --git a/src/server.ts b/src/server.ts index f353811..474d90f 100644 --- a/src/server.ts +++ b/src/server.ts @@ -3,6 +3,7 @@ import api from './api'; import path from 'path'; import { AuthenticationRulesTypes } from './api/models/AuthenticationRules'; import env from './utils/environments'; +import bodyparser from "body-parser"; const app = express(); const port = 3000; @@ -14,6 +15,9 @@ declare module 'express-serve-static-core' { } } +// Bodyparser +app.use(bodyparser.json()); + // Checking auth app.use((req, res, next) => { req.authenticationRules = { type: "password" };