* Split and extract data-logic from application level * Move storage to DeeSee package * Move router into internal package * Fix Makefile * Fix documentation * Fix tests
40 lines
945 B
Makefile
40 lines
945 B
Makefile
DIST_NAME ?=deesee-superhero-service
|
|
DIST_PATH ?=build/package
|
|
PORT ?=8080
|
|
KEY ?=5
|
|
objects =$(patsubst %.go,%.o,$(wildcard *.go))
|
|
|
|
BINARY_PATH=${DIST_PATH}/${DIST_NAME}
|
|
PACKAGE_PATH=github.com/eslider/superherohub
|
|
|
|
# Build the project service
|
|
build:
|
|
go build -o ${BINARY_PATH} cmd/hub/main.go
|
|
|
|
# Run the project
|
|
run:
|
|
go build -o ${BINARY_PATH} cmd/hub/main.go
|
|
${BINARY_PATH}
|
|
|
|
|
|
# Test the project
|
|
test:
|
|
go test -v -cover ./...
|
|
echo ${PORT}
|
|
|
|
# This test ork only by developer
|
|
# Please ignore this
|
|
test-store:
|
|
curl -v -X PUT \
|
|
-H 'Accept: */*' \
|
|
-H 'Connection: keep-alive' \
|
|
-H 'Cache-Control: no-cache' \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"name":"supermans","identity":{"firstName":"Kent","lastName":"Clark"},"superpowers":["flight","strength","invulnerability"],"birthday":"1977-04-18"}' \
|
|
http://127.0.0.1:${PORT}/superheroes
|
|
|
|
# Clean the project
|
|
clean:
|
|
go clean
|
|
rm ${BINARY_PATH}
|