add bodyparser
This commit is contained in:
parent
c235bf73a8
commit
0c9249a4c8
1
package-lock.json
generated
1
package-lock.json
generated
@ -7,6 +7,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/express": "^5.0.6",
|
"@types/express": "^5.0.6",
|
||||||
"@types/node": "^25.6.0",
|
"@types/node": "^25.6.0",
|
||||||
|
"body-parser": "^2.2.2",
|
||||||
"express": "^5.2.1",
|
"express": "^5.2.1",
|
||||||
"tsc-alias": "^1.8.16",
|
"tsc-alias": "^1.8.16",
|
||||||
"typescript": "^6.0.3"
|
"typescript": "^6.0.3"
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/express": "^5.0.6",
|
"@types/express": "^5.0.6",
|
||||||
"@types/node": "^25.6.0",
|
"@types/node": "^25.6.0",
|
||||||
|
"body-parser": "^2.2.2",
|
||||||
"express": "^5.2.1",
|
"express": "^5.2.1",
|
||||||
"tsc-alias": "^1.8.16",
|
"tsc-alias": "^1.8.16",
|
||||||
"typescript": "^6.0.3"
|
"typescript": "^6.0.3"
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import api from './api';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { AuthenticationRulesTypes } from './api/models/AuthenticationRules';
|
import { AuthenticationRulesTypes } from './api/models/AuthenticationRules';
|
||||||
import env from './utils/environments';
|
import env from './utils/environments';
|
||||||
|
import bodyparser from "body-parser";
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const port = 3000;
|
const port = 3000;
|
||||||
@ -14,6 +15,9 @@ declare module 'express-serve-static-core' {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bodyparser
|
||||||
|
app.use(bodyparser.json());
|
||||||
|
|
||||||
// Checking auth
|
// Checking auth
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
req.authenticationRules = { type: "password" };
|
req.authenticationRules = { type: "password" };
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user