Add hot-reload support with air for Go backend
- Add .air.toml configuration for Go hot-reloading - Add 'dev' target to run both frontend and backend together - Update dev-backend to use air instead of go run - Install air with: go install github.com/air-verse/air@latest
This commit is contained in:
parent
44dea14885
commit
ad159b2549
2 changed files with 26 additions and 4 deletions
12
Makefile
12
Makefile
|
|
@ -1,4 +1,4 @@
|
|||
.PHONY: all dev-frontend dev-backend build build-frontend build-backend clean test lint
|
||||
.PHONY: all dev dev-frontend dev-backend build build-frontend build-backend clean test lint
|
||||
|
||||
# Variables
|
||||
APP_NAME := imc-vibe
|
||||
|
|
@ -30,13 +30,16 @@ build-backend: build-frontend
|
|||
@echo "Backend built successfully"
|
||||
|
||||
# Development targets
|
||||
dev: dev-frontend dev-backend
|
||||
@echo "Development mode running..."
|
||||
|
||||
dev-frontend:
|
||||
@echo "Starting frontend dev server..."
|
||||
cd $(FRONTEND_DIR) && bun run dev
|
||||
|
||||
dev-backend:
|
||||
@echo "Starting backend dev server..."
|
||||
cd $(BACKEND_DIR) && USE_EMBEDDED=false go run ./cmd/server
|
||||
@echo "Starting backend dev server (hot-reload enabled)..."
|
||||
cd $(BACKEND_DIR) && USE_EMBEDDED=false air
|
||||
|
||||
# Clean build artifacts
|
||||
clean:
|
||||
|
|
@ -63,8 +66,9 @@ help:
|
|||
@echo " build - Build frontend and backend"
|
||||
@echo " build-frontend - Build frontend only"
|
||||
@echo " build-backend - Build backend only"
|
||||
@echo " dev - Start both frontend and backend with hot-reload"
|
||||
@echo " dev-frontend - Start frontend dev server"
|
||||
@echo " dev-backend - Start backend dev server"
|
||||
@echo " dev-backend - Start backend dev server (requires: go install github.com/air-verse/air@latest)"
|
||||
@echo " clean - Remove build artifacts"
|
||||
@echo " test - Run backend tests"
|
||||
@echo " lint - Run Go vet"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue