Closed yarikbratashchuk closed 7 years ago
Keep in mind HandleFunc()
is for interacting with the Node.js shim, so it's actually expecting an .event
property:
$ echo '{ "event": { "hello": "foo" }}' | go run _examples/go/functions/simple/main.go
{"value":{"hello":"foo"}}
Whereas apex invoke
does not (but only supports calling the remote lambda currently). For testing locally I just recommend writing libraries / unit tests.
@tj yes, i should have seen it. Thank you.
no problem!
Hello. I got a problem, and i can't figure out where i go wrong.
So i have empty event, and
{"error":"unexpected end of JSON input"}
appears. I run function like this:echo '{"link":"https://google.com"}'|go run main.go handler.go
Am I doing it wrong?And I want to mention that it works when it is deployed.