add bodyparser

This commit is contained in:
FullGreaM 2026-05-03 03:04:50 +03:00
parent c235bf73a8
commit 0c9249a4c8
3 changed files with 6 additions and 0 deletions

1
package-lock.json generated
View File

@ -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"

View File

@ -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"

View File

@ -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" };