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 body parser middleware component #72

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add body parser middleware component #72

wants to merge 3 commits into from

Conversation

bergie
Copy link
Member

@bergie bergie commented Apr 5, 2017

No description provided.

@bergie bergie requested a review from trustmaster April 5, 2017 16:38
@trustmaster
Copy link
Member

This raises the question: do we need all the middleware components in this package? The original intention of this library was to move away from the granularity of https://github.com/djdeath/noflo-express and provide higher-level building blocks with application-specific logic delegated to user's code.

@trustmaster
Copy link
Member

Also, this component should be named BodyParserJSON rather than BodyParser.

@bergie
Copy link
Member Author

bergie commented Apr 6, 2017

Fair point. On the other hand, pretty much every Express app is going to want to have body parser set up.


c.process (input, output) ->
return unless input.hasData 'app'
limit = if input.hasData('limit') then input.getData('limit') else '1mb'
Copy link
Member

Choose a reason for hiding this comment

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

This is race-prone, should use return if input.attached('limit').length and not input.hasData('limit').

@trustmaster
Copy link
Member

@bergie then we should provide BodyParserUrlencoded as well.

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