Skip to content

Commit

Permalink
Merge pull request #108 from PraneshASP/patch-1
Browse files Browse the repository at this point in the history
Update express.ts
  • Loading branch information
santiq authored Aug 16, 2021
2 parents 38789d0 + 0cf9ce6 commit 2813554
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/loaders/express.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import express from 'express';
import bodyParser from 'body-parser';
import cors from 'cors';
import { OpticMiddleware } from '@useoptic/express-middleware';
import routes from '@/api';
Expand Down Expand Up @@ -30,8 +29,8 @@ export default ({ app }: { app: express.Application }) => {
// Maybe not needed anymore ?
app.use(require('method-override')());

// Middleware that transforms the raw string of req.body into json
app.use(bodyParser.json());
// Transforms the raw string of req.body into json
app.use(express.json());
// Load API routes
app.use(config.api.prefix, routes());

Expand Down

0 comments on commit 2813554

Please sign in to comment.