Live reload for Golang and others
With go 1.23 or higher:
go install github.com/lasfh/eletrize@latest
$ eletrize run ./server "go build" --ext=.go --label="API" --env=.env
Detect files with names: eletrize.yml, eletrize.yaml, .eletrize.yml, .eletrize.yaml, eletrize.json, .eletrize.json and .eletrize (JSON format)'.
$ eletrize eletrize.yml
$ eletrize eletrize.yml --schema=NUMBER (>= 1)
schema:
- label: SCHEMA NAME
workdir: ""
envs:
key: "value"
env_file: ".env"
watcher:
path: "."
recursive: true
excluded_paths:
- "frontend"
extensions:
- ".go"
- ".js"
commands:
build:
method: "go"
args:
- "build"
envs:
key: "value"
env_file: ""
run:
- label: WORKER
method: "./worker"
envs:
key: "value"
env_file: ""