Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Serve: JSON Body Handling #95

Closed
jonsharratt opened this issue Jan 31, 2017 · 5 comments
Closed

Serve: JSON Body Handling #95

jonsharratt opened this issue Jan 31, 2017 · 5 comments

Comments

@jonsharratt
Copy link

jonsharratt commented Jan 31, 2017

Not sure if anyone else if having the same issue but the Lambda Proxy integration functions I have setup when deployed do not parse the JSON and thus the events body property requires parsing in my lambda function (e.g. https://github.com/craftship/yith/blob/master/src/user/put.js#L8) when a request is sent with Content-Type application/json.

In order to replicate the same functionallity when running the webpack serve command I had to do the following:
master...craftship:use-text-parser

I have not raised a PR yet as wanted to see if I was missing anything obvious / missed something I should test further.

Let me know, thanks for the awesome plugin has really helped our project long!

@jonsharratt jonsharratt changed the title Server: JSON Body Handling Serve: JSON Body Handling Jan 31, 2017
@anozaki
Copy link

anozaki commented Feb 15, 2017

I'm having the same problem.

This is a quote from the serverless documentation regarding lambda-proxy.
https://serverless.com/framework/docs/providers/aws/events/apigateway/

Note: When the body is a JSON-Document, you must parse it yourself

@anozaki
Copy link

anozaki commented Feb 15, 2017

Just looked at your change. I think you need to do a little bit more. I think you only want to switch to text parser if the integration type is lambda-proxy.

@jonsharratt
Copy link
Author

Will amend and raise the PR thanks for confirming this and taking a look into it :D

@HyperBrain
Copy link
Member

@jonsharratt @anozaki If you use the serve functionality, it would be great if you could comment in #135 .

@HyperBrain
Copy link
Member

serve will be removed in the next v3.0.0 release in favor of serverless-offline (see #152 ). No efforts will be spent on the function anymore. So I'll close this issue.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants