functions-framework-go
functions-framework-go copied to clipboard
Support for hot reload in dev environment
The recommended method to start functions framework locally is to have cmd/main.go. I start the server using go run cmd/main.go. Each time I make changes I have to quite the program and rerun it.
I couldn't find any way in documentation on how to have hot reload on source code changes.
Reference: Python's function-framework supports --debug flag for this purpose.
if someone stumbles upon before before enhancement get shipped. I ended up using air. Here is the .air.toml(at root directory) file that I used
root = "."
tmp_dir = "tmp"
[build]
cmd = "go build -o ./tmp/main ./cmd/main.go"
bin = "tmp/main"
full_bin = "tmp/main"
include_ext = ["go"]
exclude_dir = ["tmp"]
delay = 1000 # in milliseconds
[log]
time = true
[screen]
clear_on_rebuild = true