Switching from bodyparser to express function
This commit is contained in:
parent
66c7b539b3
commit
d3bf8d1bd9
3
app.ts
3
app.ts
|
@ -1,6 +1,5 @@
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import * as http from 'http';
|
import * as http from 'http';
|
||||||
import * as bodyparser from 'body-parser';
|
|
||||||
import * as dotenv from 'dotenv';
|
import * as dotenv from 'dotenv';
|
||||||
// Router imports
|
// Router imports
|
||||||
import {partyPlanerRouter} from './src/models/partyplaner/PartyPlaner.router';
|
import {partyPlanerRouter} from './src/models/partyplaner/PartyPlaner.router';
|
||||||
|
@ -20,7 +19,7 @@ const app: express.Application = express();
|
||||||
const server: http.Server = http.createServer(app);
|
const server: http.Server = http.createServer(app);
|
||||||
|
|
||||||
// here we are adding middleware to parse all incoming requests as JSON
|
// here we are adding middleware to parse all incoming requests as JSON
|
||||||
app.use(bodyparser.json());
|
app.use(express.json());
|
||||||
|
|
||||||
// Add routers
|
// Add routers
|
||||||
app.use('/dhbw-service', dhbwServiceRouter);
|
app.use('/dhbw-service', dhbwServiceRouter);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user