-
Notifications
You must be signed in to change notification settings - Fork 12
remove unnecessary use of json body parser #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
eliasmalik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other steps where the body-parser module is referred to, not just step 10. Please make sure you make appropriate changes to those steps as well.
Thanks!
| // parse incoming json | ||
| app.use(bodyParser.json()); | ||
| // parse urlencoded bodies | ||
| app.use(bodyParser.urlencoded({ extended: false })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you actually run the code after your changes?
Running this file will result in a ReferenceError because you've removed line 5, where bodyParser is defined, yet still refer to it on line 14.
| const express = require('express'); | ||
| const path = require('path'); | ||
| const favicon = require('serve-favicon'); | ||
| // import 'body-parser' module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to import the module. See my comment below to understand why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oooops ! sorry I will do it 👍
|
@Marwabj In my review comment I wrote
As mentioned here, step 11, and all steps after it, also use the JSON body parser. We can remove those references just like in step 10. Once you do so I can merge this PR. |
|
Is this outdated, or is this still in review cc: @astroash @shiryz @oliverjam @m4v15 ? |
|
It's been over a year since the last activity so someone else might need to take over if we want to get it merged |
#853