Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for hot reload in dev environment #255

Open
kashif-ghafoor opened this issue Dec 2, 2024 · 1 comment
Open

Support for hot reload in dev environment #255

kashif-ghafoor opened this issue Dec 2, 2024 · 1 comment
Labels
enhancement New feature or request P4 Icebox Priority

Comments

@kashif-ghafoor
Copy link

kashif-ghafoor commented Dec 2, 2024

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.

@dixuswe dixuswe removed their assignment Dec 4, 2024
@HKWinterhalter HKWinterhalter added enhancement New feature or request P2 Normal Priority labels Dec 4, 2024
@kashif-ghafoor
Copy link
Author

kashif-ghafoor commented Dec 27, 2024

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

@HKWinterhalter HKWinterhalter added P4 Icebox Priority and removed P2 Normal Priority labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P4 Icebox Priority
Projects
None yet
Development

No branches or pull requests

3 participants