Comments (7)
Hi @peebles thanks for noticing this.
Are you saying that AWS always adds a "payload" key to the "event" object when using the POST method? If yes this is a major bug of the plugin.
Here's a quick fix to your pb, until we solve it globally:
"requestTemplates": {
"application/json": {
"payload": "$input.json('$')",
"sourceIp": "$context.identity.sourceIp"
}
}
from serverless-offline.
No, that's not what I am saying. I'm saying that given the s-function.json I showed, if I post { "foo": "bar" } to amazon, I get event.foo==bar, but in offset plugin I get event.foo==undefined.
On Jun 2, 2016, at 1:01 AM, David HΓ©rault [email protected] wrote:
Hi @peebles thanks for noticing this.
Are you saying that AWS always adds a "payload" key to the "event" object when using the POST method? If yes this is a major bug of the plugin.
Here's a quick fix to your pb, until we solve it globally:
"requestTemplates": {
"application/json": {
"payload": "$input.json('$')",
"sourceIp": "$context.identity.sourceIp"
}
}
β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
from serverless-offline.
Thanks, this is officially a bug now π
Will work on it.
from serverless-offline.
Ok what about now, v2.6.0
from serverless-offline.
I'm running 2.6.0 and still my event object == {"isOffline":true}
:/
Also the payload workaround does not work either.
from serverless-offline.
@cspeer, your debug indicates payload is empty and requestTemplate is undefined, shown from here. This is likely due to a missing application/json
as Content-Type
header. If that doesn't help, could you post the code you're using for fetch and your s-function.json file?
from serverless-offline.
@dbunker Yes, you were right, I forgot to set the appropriate header. Everything is fine now!
from serverless-offline.
Related Issues (20)
- Unhandled exception in handler 'index'. HOT 1
- Bump serverless-offline version to 12.0.5 HOT 1
- How to run lambda integration mode in serverless locally
- App hangs when launching in debug mode on Webstorm HOT 2
- ALB event doesn't reflect custom headers specified in handler.ts HOT 2
- dotnet6 future donet7 support HOT 1
- clientCert property is undefined when client certificates are used
- Extend support for ALB event paths
- Enable mixed API usage with same routes
- SLS_ACCOUNT_ID identity override for schedule events
- I think you removed Node 16 support too soon HOT 1
- How to set timeout properly HOT 1
- Add support for nodejs20.x runtime
- Stripping trailing slashes breaks django admin
- Inconsistency in `authorizer` Model When Using `serverless-offline` with AWS PowerTools for Lambda HOT 2
- How to clear cache on cognito HOT 1
- x-api-key no longer being provided HOT 4
- Lambci docker images are deprecated and no more maintained. HOT 1
- contentHandling
- MaxListenersExceededWarning with esbuild
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-offline.