This article was originally published on bmf-tech.com.
Overview
Tried using github - oxequa/realize.
Preparation
go get github.com/oxequa/realize
Usage
./demo/
├── .realize.yaml
└── main.go
.realize.yaml
settings:
legacy:
force: false
interval: 0s
schema:
- name: demo
path: .
commands:
run:
status: true
watcher:
extensions:
- go
paths:
- /
ignored_paths:
- .git
- .realize
- vendor
main.go
package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello World")
}
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/", handler)
http.ListenAndServe(":8080", mux)
}
In the demo directory, running realize start --server will start the monitoring server, enabling hot reload.
Monitoring server
http://localhost:5002/#/demo
You can view logs, errors, and output.
Server started by main.go
http://localhost:8080
Impressions
It's easy to set up and convenient, so I think I'll use this for hot reloading.
Top comments (0)