Open ahmetb opened 4 years ago
I didn't run it locally, but I referenced this repo and deployed to netlify, it works like a charm!
You can test it here: https://unibeta.netlify.app/.netlify/functions/hello-lambda
The build log:
1:53:33 PM: ────────────────────────────────────────────────────────────────
1:53:33 PM: 1. build.command from netlify.toml
1:53:33 PM: ────────────────────────────────────────────────────────────────
1:53:33 PM:
1:53:33 PM: $ make build
1:53:33 PM: go get ./api/...
1:53:35 PM: go build -o api/hello-lambda ./api/...
The repo: https://github.com/Jeff-Tian/beta (it's private but I invited you to access it for reference)
go build
to make the function built firstly to run locally.when running locally i get the following. Im assuming this is something Netlify fills in between AWS and Netlify but how can i test the go build without this?
expected AWS Lambda environment variables [_LAMBDA_SERVER_PORT AWS_LAMBDA_RUNTIME_API] are not defined
Same issue! Did anyone manage to figure this out?
I see the Function not found...
message aswell.
According to this, netlify dev
does not work with Go functions https://answers.netlify.com/t/working-with-go-functions-locally-and-in-deployment/3530/7
The Netlify CLI tool (aka netlify dev) will allow for local testing of javascript functions/lambdas but not functions/lambdas written in Go.
I cloned this repo, ran
netlify dev
and headed to http://localhost:8888/.netlify/functions/hello-lambda and gotFunction not found...
.Is this supposed to work?
I initialized the repo with go.mod as well, that doesn't seem to help either. Since this is linked from https://docs.netlify.com/functions/build-with-go/, it should probably work?