Live Reload
It is convenient to automatically restart the service every time you save your changes. For that, you can use air, which is a separate Go package you can install using the following command:
go install github.com/cosmtrek/air@latest
Once air
is installed, you simply need to run air
to start the service. Configurations for this can be found under ./.air.toml
.
Live reloading will also work in Docker. The Dockerfile.dev
is configured to install and run the service via air
.