Open drew-corporate-creations opened 3 years ago
can you provide an example app which reproduces?
can you provide an example app which reproduces?
https://github.com/drew-corporate-creations/demo
I Created a demo app using micronaut launch, added 2 post methods to the controller, then added a cloud formation file and deployment script. To deploy it, run ./deploy.sh. 4 params are required to deploy it (you'll see them in the file). After deployment, grab the url from API Gateway. Make a POST to the 2 endpoints using {"Some": "Test"} as the body.
https://
Check the CloudWatch logs and you will see the error.
are you creating the API Gateway with Cloud formation?
Yes. In the sample project there is a cloud formation template. I used AWS SAM (https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started.html) and cloud formation cli to deploy it. There's a deployment script in the sample project as well. However you'll get the same result if you don't use cloud formation.
I realize in my previous post it should say
https://\<api-gateway-url>/Stage/doesNotWork1 https://\<api-gateway-url>/Stage/doesNotWork2
Any update on this issue?
Expected Behavior
This works locally using the netty server. However it does not work when deployed in lambda with API Gateway.
Using a post method in a controller:
My goal is to get the body of the request as a string. Expected behavior is a 200 response with logging lines showing the request body.
Actual Behaviour
Below is the stack trace in CloudWatch for when I post with a payload of: {"Some": "Test"}
Steps To Reproduce
To reproduce, create a micronaut controller with a post method that takes an (HttpRequest) OR (@Body String body). Deploy this to aws with API Gateway in front using proxy+.
Environment Information
Java 8 Micronaut 2.5.4
Example Application
No response
Version
2.5.4