Skip to content
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

Add bodyParser #515

Merged
merged 1 commit into from
Nov 16, 2017
Merged

Add bodyParser #515

merged 1 commit into from
Nov 16, 2017

Conversation

hyungheo
Copy link
Collaborator

@hyungheo hyungheo commented Nov 9, 2017

Add bodyParser Module and Test
It is needed for handling a request of post

ISSUE=#458

Copy link
Member

@romandev romandev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know this patch's purpose and goal.
Could you explain in more details?

this.app.use(express.static(path.join(__dirname, '../client')));
this.app.use(bodyParser.json({limit: '10mb'}));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this limit?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON is limited under 100KB as default.
Default size is not enough to handling big-data through JSON.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, is there any use case in this patch?
If you have an use case, then please add it.
Otherwise, IMHO, remove it.

this.app.use(express.static(path.join(__dirname, '../../out/client')));
this.app.use(bodyParser.json({limit: '10mb'}));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -22,4 +22,15 @@ export class Test {
public get(request: express.Request, response: express.Response): void {
response.send('hello world');
}
public post(request: express.Request, response: express.Response): void {
if (request.body) {
if (request.body.userId === 'absolute') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why userId? I think we need a better name for example.

@hyungheo
Copy link
Collaborator Author

hyungheo commented Nov 9, 2017

Express (>4.0) needs body-Parser to parse request.body which has a specific data such as json or x-www-form-urlencoded when it's handling a POST.
I'll include some POST-API

@romandev
Copy link
Member

romandev commented Nov 9, 2017

@hyungheo I understand your words. Thank you for explanation.
So, please update your commit description and title in more details (applying your previous comment).

@hyungheo hyungheo force-pushed the Add_bodyParser branch 2 times, most recently from 18c13d1 to f9bbf8d Compare November 16, 2017 00:55
Copy link
Member

@romandev romandev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, there are some lint errors in this patch.
https://travis-ci.org/lunchclass/absolute/jobs/302789423

this.app.use(express.static(path.join(__dirname, '../client')));
this.app.use(bodyParser.json({limit: '10mb'}));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, is there any use case in this patch?
If you have an use case, then please add it.
Otherwise, IMHO, remove it.

Copy link
Member

@romandev romandev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./absolute lint and ./absolute lint:fix will be helpful to you.

@hyungheo hyungheo force-pushed the Add_bodyParser branch 4 times, most recently from e7a580c to 57678c8 Compare November 16, 2017 01:50
Add bodyParser Module and Test
It is needed for handling a request as post

ISSUE=lunchclass#458
@romandev romandev merged commit f17d818 into lunchclass:master Nov 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants