Switching from bodyparser to express function

This commit is contained in:
Patrick Müller 2021-08-20 13:23:56 +02:00
parent 66c7b539b3
commit d3bf8d1bd9

3
app.ts
View File

@ -1,6 +1,5 @@
import express from 'express';
import * as http from 'http';
import * as bodyparser from 'body-parser';
import * as dotenv from 'dotenv';
// Router imports
import {partyPlanerRouter} from './src/models/partyplaner/PartyPlaner.router';
@ -20,7 +19,7 @@ const app: express.Application = express();
const server: http.Server = http.createServer(app);
// here we are adding middleware to parse all incoming requests as JSON
app.use(bodyparser.json());
app.use(express.json());
// Add routers
app.use('/dhbw-service', dhbwServiceRouter);