- create file log at "/var/log/efishery-test/efishery-test.log"
sudo mkdir /var/log/efishery-test && sudo chmod -R 777 /var/log/efishery-test
- run file with command
// auth app
go run cmd/app/efishery-test/auth.go
// fetch app
go run cmd/app/efishery-test/fetch.go
-
Run mysql migration from sql/init.sql
-
visit url http://localhost:8081 (auth app) & http://localhost:8082 (fetch app)
-
auth app:
- register
- url : http://localhost:8081/register
- method : POST
- payload json:
{ "username" : "bana1234", "phone" : "0811111111" "role" : "admin" }
- login:
- url : http://localhost:8081/login
- method : POST
- payload json:
{ "phone" : "0811111111", "password" : "XVlB" }
- auth token - claim data:
- url : http://localhost:8081/auth
- method : GET
- headers
{ "Authorization" : "Bearer {token}" }
- register
-
fetch app:
- fetch product
- url : http://localhost:8082/fetch-product
- method : GET
- headers:
{ "Authorization" : "Bearer {token}" }
- fetch product compiled
- url : http://localhost:8082/fetch-product-compiled
- method : GET
- headers:
{ "Authorization" : "Bearer {token}" }
- auth token - claim data:
- url : http://localhost:8082/auth
- method : GET
- headers
{ "Authorization" : "Bearer {token}" }
- fetch product