-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add bodyParser #515
Conversation
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.
I don't know this patch's purpose and goal.
Could you explain in more details?
server/base/application.ts
Outdated
this.app.use(express.static(path.join(__dirname, '../client'))); | ||
this.app.use(bodyParser.json({limit: '10mb'})); |
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.
Do we really need this limit?
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.
JSON is limited under 100KB as default.
Default size is not enough to handling big-data through JSON.
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.
So, is there any use case in this patch?
If you have an use case, then please add it.
Otherwise, IMHO, remove it.
server/base/application.ts
Outdated
this.app.use(express.static(path.join(__dirname, '../../out/client'))); | ||
this.app.use(bodyParser.json({limit: '10mb'})); |
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.
ditto
server/example/example.router.ts
Outdated
@@ -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') { |
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.
Why userId? I think we need a better name for example.
0064058
to
4dd9ba7
Compare
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. |
@hyungheo I understand your words. Thank you for explanation. |
18c13d1
to
f9bbf8d
Compare
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.
Also, there are some lint errors in this patch.
https://travis-ci.org/lunchclass/absolute/jobs/302789423
server/base/application.ts
Outdated
this.app.use(express.static(path.join(__dirname, '../client'))); | ||
this.app.use(bodyParser.json({limit: '10mb'})); |
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.
So, is there any use case in this patch?
If you have an use case, then please add it.
Otherwise, IMHO, remove it.
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.
./absolute lint
and ./absolute lint:fix
will be helpful to you.
e7a580c
to
57678c8
Compare
Add bodyParser Module and Test It is needed for handling a request as post ISSUE=lunchclass#458
57678c8
to
1310f1e
Compare
Add bodyParser Module and Test
It is needed for handling a request of post
ISSUE=#458