Refactor router and storage
* Split and extract data-logic from application level * Move storage to DeeSee package * Move router into internal package * Fix Makefile * Fix documentation * Fix tests
This commit is contained in:
26
Makefile
26
Makefile
@@ -1,24 +1,26 @@
|
||||
DIST_NAME=superhero
|
||||
DIST_PATH=dist
|
||||
PACKAGE_PATH=github.com/eslider/superherohub
|
||||
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
|
||||
# Build the project service
|
||||
build:
|
||||
go build -o ${BINARY_PATH} ${PACKAGE_PATH}
|
||||
|
||||
go build -o ${BINARY_PATH} cmd/hub/main.go
|
||||
|
||||
# Run the project
|
||||
run:
|
||||
go build -o ${BINARY_PATH} ${PACKAGE_PATH}
|
||||
go build -o ${BINARY_PATH} cmd/hub/main.go
|
||||
${BINARY_PATH}
|
||||
|
||||
|
||||
# Test and build the project
|
||||
# Test the project
|
||||
test:
|
||||
go test -v -cover ${PACKAGE_PATH}/pkg/deesee
|
||||
go test -v -cover ${PACKAGE_PATH}/pkg/people
|
||||
go test -v -cover -count 10 ${PACKAGE_PATH}
|
||||
go test -v -cover ./...
|
||||
echo ${PORT}
|
||||
|
||||
# This test ork only by developer
|
||||
# Please ignore this
|
||||
@@ -29,7 +31,7 @@ test-store:
|
||||
-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:8080/superheroes
|
||||
http://127.0.0.1:${PORT}/superheroes
|
||||
|
||||
# Clean the project
|
||||
clean:
|
||||
|
||||
Reference in New Issue
Block a user