chore: makefile, http server command
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
.vscode/
|
||||||
|
artifacts/
|
||||||
@@ -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
|
||||||
@@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user