Skip to content

Commit

Permalink
Removed body-parser package (included in Express 4.16).
Browse files Browse the repository at this point in the history
  • Loading branch information
orlandotorres committed Apr 20, 2018
1 parent 0cfc990 commit c5b9e32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"dependencies": {
"async": "^2.6.0",
"bcrypt-nodejs": "^0.0.3",
"body-parser": "^1.18.2",
"compression": "^1.7.2",
"connect-mongo": "^2.0.0",
"dotenv": "^5.0.1",
Expand All @@ -45,7 +44,6 @@
"devDependencies": {
"@types/async": "^2.0.49",
"@types/bcrypt-nodejs": "^0.0.30",
"@types/body-parser": "^1.16.8",
"@types/compression": "^0.0.36",
"@types/dotenv": "^4.0.3",
"@types/errorhandler": "^0.0.32",
Expand Down
9 changes: 4 additions & 5 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import bodyParser from 'body-parser';
import compression from 'compression';
import mongo from 'connect-mongo';
import express from 'express';
Expand All @@ -14,7 +13,7 @@ import { MONGODB_URI, SESSION_SECRET } from './utils/secrets';
import * as passportConfig from './config/passport';

// Routes
import users from './routes/users';
import usersRouter from './routes/users';

// Connect to MongoDB
const mongoUrl = MONGODB_URI;
Expand All @@ -34,8 +33,8 @@ const app = express();
// Express configuration
app.set('port', process.env.PORT || 3000);
app.use(compression());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(expressValidator());
app.use(passport.initialize());
app.use(passport.session());
Expand All @@ -59,6 +58,6 @@ app.use(
);

// API routes.
app.use('/users', users);
app.use('/users', usersRouter);

export default app;

0 comments on commit c5b9e32

Please sign in to comment.