chore(dev): run backend with air
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -22,7 +22,7 @@ The frontend builds to `frontend/public/dist/`, then `make frontend` copies the
|
|||||||
make all # Build frontend + backend
|
make all # Build frontend + backend
|
||||||
make frontend # Build frontend, copy to backend/web/static/
|
make frontend # Build frontend, copy to backend/web/static/
|
||||||
make backend # Build Go binary (requires frontend assets)
|
make backend # Build Go binary (requires frontend assets)
|
||||||
make dev # Run both with hot-reload
|
make dev # Run frontend watcher + backend hot reload via air
|
||||||
make tests # Run Go tests
|
make tests # Run Go tests
|
||||||
make docker # Build Docker image
|
make docker # Build Docker image
|
||||||
```
|
```
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -27,7 +27,7 @@ clean:
|
|||||||
dev:
|
dev:
|
||||||
rm -rf frontend/public/dist
|
rm -rf frontend/public/dist
|
||||||
cd frontend && bun run build
|
cd frontend && bun run build
|
||||||
cd backend && AETHERA_STATIC_DIR=../frontend/public go run ./cmd --listen 0.0.0.0 & \
|
cd backend && AETHERA_STATIC_DIR=../frontend/public air & \
|
||||||
backend_pid=$$!; \
|
backend_pid=$$!; \
|
||||||
trap 'kill $$backend_pid' INT TERM EXIT; \
|
trap 'kill $$backend_pid' INT TERM EXIT; \
|
||||||
cd frontend && bun run dev
|
cd frontend && bun run dev
|
||||||
|
|||||||
30
backend/.air.toml
Normal file
30
backend/.air.toml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
root = "."
|
||||||
|
tmp_dir = "tmp"
|
||||||
|
|
||||||
|
[build]
|
||||||
|
cmd = "go build -o ./tmp/aethera ./cmd"
|
||||||
|
bin = "./tmp/aethera"
|
||||||
|
full_bin = "./tmp/aethera --listen 0.0.0.0"
|
||||||
|
delay = 1000
|
||||||
|
exclude_dir = ["data", "dist", "tmp", "web/static"]
|
||||||
|
exclude_file = []
|
||||||
|
exclude_regex = ["_test.go"]
|
||||||
|
include_dir = []
|
||||||
|
include_ext = ["go", "mod", "sum"]
|
||||||
|
kill_delay = "500ms"
|
||||||
|
log = "build-errors.log"
|
||||||
|
send_interrupt = true
|
||||||
|
stop_on_error = true
|
||||||
|
|
||||||
|
[color]
|
||||||
|
app = ""
|
||||||
|
build = "yellow"
|
||||||
|
main = "magenta"
|
||||||
|
runner = "green"
|
||||||
|
watcher = "cyan"
|
||||||
|
|
||||||
|
[log]
|
||||||
|
time = false
|
||||||
|
|
||||||
|
[misc]
|
||||||
|
clean_on_exit = true
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
## Stack
|
## Stack
|
||||||
|
|
||||||
- **Go 1.25.5** (`reichard.io/aethera`)
|
- **Go 1.25.5** (`reichard.io/aethera`)
|
||||||
|
- **air** (backend hot reload for `make dev`)
|
||||||
- **cobra** (CLI framework)
|
- **cobra** (CLI framework)
|
||||||
- **logrus** (structured logging)
|
- **logrus** (structured logging)
|
||||||
- **openai-go/v3** (OpenAI API client)
|
- **openai-go/v3** (OpenAI API client)
|
||||||
|
|||||||
Reference in New Issue
Block a user