Hot reloading not working for go lambdas?
See original GitHub issueIs it just me or hot-reloading doesn’t work for lambdas written in golang?
cmd
aws-sam-local local start-api
hello/main.go
package main
import (
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
)
type Response struct {
Message string `json:"message"`
}
func Handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
return events.APIGatewayProxyResponse{
Body: "Go Serverless v1.0! Your function executed successfully!",
StatusCode: 200,
}, nil
}
func main() {
lambda.Start(Handler)
}
template.yml
AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: A hello world application.
Resources:
HelloFunction:
Type: AWS::Serverless::Function
Properties:
Handler: bin/hello
Runtime: go1.x
Events:
Vote:
Type: Api
Properties:
Path: /hello
Method: get
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Hot reloading not working for go lambdas? · Issue #353 - GitHub
When running local start-api could you build the invoked function defined in CodeUri before mounting to Docker . Running sam build every time...
Read more >serverless offline start hot reload not working - Stack Overflow
Try using this command to start your server: serverless offline start --reloadHandler. reloadHandler Reloads handler with each request.
Read more >Hot reloading not working : r/gatsbyjs - Reddit
Worked for a while but now I have to restart the server constantly to get it going. I found some stackoverflow posts but...
Read more >I made a local development, debugging and hotreload tool for ...
The lambda developer experience is pretty awful. I generally put "main" methods in all my lambdas so I can test them locally, but...
Read more >Hot Swapping - LocalStack Docs
Code hot-swapping for JVM Lambdas. Since lambda containers lifetime is usually limited, regular hot code swapping techniques are not applicable here.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
thanks @mijdavis2, I implemented a workaround (in the meantime) for hot reload to work when developing Go lambdas locally - https://github.com/uccmen/serverless-go
@uccmen We do support hot-reloading of each language. The term hot-reloading to us means we will always mount the CodeUri on the next invoke. This allows you to stand up one api locally, and change/build your code outside that process to be reflected on the next invoke.
Closing this as we currently support it, but if we have a misunderstanding please reopen or create a new issue.