Init: bootstrap

This commit is contained in:
Yi-Ting Shih
2025-12-07 02:33:44 +08:00
commit a4096bf1a7
16 changed files with 1052 additions and 0 deletions

28
Makefile Normal file
View File

@@ -0,0 +1,28 @@
.PHONY: all swagger docker install test bench
SWAG ?= go run github.com/swaggo/swag/cmd/swag@v1.16.4
GO_ENV += CGO_ENABLED=0
SOURCE := $(shell find . -type f -name '*.go')
TARGET := backend
all: swagger docker install
docker: $(TARGET)
docker compose up -d --force-recreate --build backend
install:
$(GO_ENV) go install
test:
go test -v ./tests/units
bench:
go test -bench=. ./tests/benchmarks
swagger:
$(SWAG) fmt
$(SWAG) init -o docs -g cmds/serve.go -pdl 1
$(TARGET): $(SOURCE)
$(GO_ENV) go build -o $@