diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f3ec25c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.vscode/ +artifacts/ \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..31777ee --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +.DEFAULT_GOAL := build + +fmt: + @go fmt ./... +.PHONY:fmt + +vet: fmt + @go vet ./... +.PHONY:vet + +test: + @mkdir -p artifacts/test + @go clean -testcache +# first, run tests with stdout + @go test -cover ./... +# second, run cached tests with reports output + @go test ./... -coverprofile artifacts/test/coverage.out -json > artifacts/test/coverage.json + @go tool cover -html artifacts/test/coverage.out -o artifacts/test/coverage.html + +build: vet test + @go build -o artifacts/bin/server cmd/http/main.go +.PHONY:build diff --git a/cmd/http/main.go b/cmd/http/main.go new file mode 100644 index 0000000..ecb392e --- /dev/null +++ b/cmd/http/main.go @@ -0,0 +1,16 @@ +package http + +import ( + "fmt" + "os" + + "github.com/iliadenisov/galaxy/internal/router" +) + +func main() { + r := router.NewRouter() + if err := r.Run(); err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } +}