build(dev): use air for backend live reload
Some checks failed
continuous-integration/drone/pr Build is failing
Some checks failed
continuous-integration/drone/pr Build is failing
This commit is contained in:
17
.air.toml
Normal file
17
.air.toml
Normal file
@@ -0,0 +1,17 @@
|
||||
root = "."
|
||||
tmp_dir = "_scratch/air"
|
||||
|
||||
[build]
|
||||
cmd = "go build -o ./_scratch/air/antholume ."
|
||||
full_bin = "./_scratch/air/antholume serve"
|
||||
delay = 1000
|
||||
include_ext = ["go", "tpl", "tmpl", "html", "css", "js", "yaml", "yml"]
|
||||
exclude_dir = ["_scratch", "build", "data", "frontend", "node_modules"]
|
||||
exclude_file = ["assets/style.css"]
|
||||
stop_on_error = true
|
||||
|
||||
[log]
|
||||
time = true
|
||||
|
||||
[misc]
|
||||
clean_on_exit = true
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,6 +2,7 @@ TODO.md
|
||||
.DS_Store
|
||||
data/
|
||||
build/
|
||||
tmp/
|
||||
.direnv/
|
||||
cover.html
|
||||
node_modules
|
||||
|
||||
@@ -42,7 +42,7 @@ Regenerate:
|
||||
|
||||
### Common commands
|
||||
- Full dev stack: `make dev` (backend on `:8585` + Vite frontend on `:5173`)
|
||||
- Backend only: `make dev_backend`
|
||||
- Backend only: `make dev_backend` (live-reloads with Air)
|
||||
- Frontend only: `make dev_frontend`
|
||||
- Direct backend run: `CONFIG_PATH=./data DATA_PATH=./data REGISTRATION_ENABLED=true go run main.go serve`
|
||||
- No-auth dev run: `CONFIG_PATH=./data DATA_PATH=./data REGISTRATION_ENABLED=true DISABLE_AUTH=true DISABLE_AUTH_USER=evan go run main.go serve`
|
||||
|
||||
2
Makefile
2
Makefile
@@ -46,7 +46,7 @@ dev:
|
||||
$(MAKE) -j2 dev_backend dev_frontend
|
||||
|
||||
dev_backend:
|
||||
$(DEV_ENV) go run main.go serve
|
||||
$(DEV_ENV) air
|
||||
|
||||
dev_frontend:
|
||||
cd frontend && bun run dev
|
||||
|
||||
@@ -138,7 +138,7 @@ Run Development:
|
||||
make dev
|
||||
|
||||
# Or run one side only
|
||||
make dev_backend
|
||||
make dev_backend # live-reloads with air
|
||||
make dev_frontend
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user