This commit is contained in:
2026-08-29 10:29:48 +05:00
parent eaa9a7bef2
commit 069b51a84c
16 changed files with 949 additions and 471 deletions
+9 -6
View File
@@ -9,7 +9,7 @@ proto: ## Regenerate Go + TS code from proto
--es_out=web/src/gen --es_opt=target=ts \
proto/homelab/v1/homelab.proto
web: ## Build frontend into web/dist
web: ## Build frontend into web/dist (tsc + vite)
cd web && pnpm install --frozen-lockfile && pnpm build
server: ## Build Go binary
@@ -18,12 +18,15 @@ server: ## Build Go binary
dev: ## Dev: Go server on :8080 + Vite on :5173 (use http://localhost:5173)
go run ./server & cd web && pnpm dev
dev-srv:
go run ./server
dev-web:
cd web && pnpm dev
test: ## Smoke-test the RPC endpoints
@go build -o bin/server ./server
@./bin/server & sleep 1; \
for i in 1 2; do \
curl -sf -X POST localhost:8080/homelab.v1.HomelabService/IncrementCounter -H 'Content-Type: application/json' -d '{}' | grep -q "\"value\":\"$$i\"" || exit 1; \
done; \
curl -sf -X POST localhost:8080/homelab.v1.HomelabService/SayHello -H 'Content-Type: application/json' -d '{"name":"Pony"}' | grep -q 'Hello, Pony!' || exit 1; \
curl -sf -X POST localhost:8080/homelab.v1.HomelabService/GetLuckyNumber -H 'Content-Type: application/json' -d '{}' | grep -q '"number"' || exit 1; \
curl -sf -X POST localhost:8080/homelab.v1.HomelabService/ListSections -H 'Content-Type: application/json' -d '{}' | grep -q '"cpu"' || exit 1; \
curl -sf -X POST localhost:8080/homelab.v1.HomelabService/RunScript -H 'Content-Type: application/json' -d '{"name":"greet","args":["pony","42"]}' | grep -q 'arg1: pony' || exit 1; \
kill %1; echo OK