thread-master/backend/Makefile

28 lines
592 B
Makefile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.PHONY: gen-api fmt test run web-dev web-build
API_FILE := generate/api/gateway.api
GOCTL_HOME := generate/goctl
# 修改 generate/api/*.api 後執行,重新產生 routes / types / handlerlogic 已存在則保留實作)
gen-api:
goctl api go -api $(API_FILE) -dir . -style go_zero -home $(GOCTL_HOME)
fmt:
go fmt ./...
test:
go test ./...
run:
mkdir -p bin
go build -o bin/gateway gateway.go
./bin/gateway -f etc/gateway.yaml
run-dev:
go run gateway.go -f etc/gateway.yaml
web-dev:
cd web && npm install && npm run dev
web-build:
cd web && npm install && npm run build