Skip to content

Commit

Permalink
Merge pull request #7 from TwilioDevEd/DEVED-4699-missing-body-parser
Browse files Browse the repository at this point in the history
[DEVED-4699] Add a comment on missing body-parser
  • Loading branch information
micaswyers-work authored Jul 31, 2020
2 parents 1848c7b + 61c166c commit a0cde4b
Show file tree
Hide file tree
Showing 4 changed files with 677 additions and 1,537 deletions.
7 changes: 7 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ if (app.get('env') === 'development') {
}

app.use(logger('dev'));

// Since Express v4.16.0 it already includes a parser middleware (based on body-parser),
// so no need to add the dependency: `const bodyParser = require('body-parser');`.

// `require('body-parser')` may be needed in cases where additional functionality is required,
// like `bodyParser.raw([options])` or `bodyParser.text([options])`.

app.use(express.json());
app.use(express.urlencoded({ extended: false }));

Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
"test_watch": "./node_modules/.bin/mocha -w test"
},
"dependencies": {
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-mocha": "^6.2.2",
"eslint": "^7.5.0",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-mocha": "^7.0.1",
"express": "~4.17.1",
"http-errors": "~1.7.3",
"mocha": "^7.0.1",
"morgan": "~1.9.1",
"http-errors": "~1.8.0",
"mocha": "^8.1.0",
"morgan": "~1.10.0",
"should": "^13.2.3",
"supertest": "^4.0.2",
"tracer": "^1.0.2",
"twilio": "^3.39.4"
"tracer": "^1.1.3",
"twilio": "^3.48.1"
},
"devDependencies": {
"chai": "^4.2.0"
Expand Down
1 change: 0 additions & 1 deletion test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require('chai');

const supertest = require('supertest');


function Session() {
return supertest(require('../app')); // eslint-disable-line global-require
}
Expand Down
Loading

0 comments on commit a0cde4b

Please sign in to comment.