API repository for sakaba.link
docker build --no-cache -t sakaba/api .
docker run --rm -d \
-e APP_CONFIG_JSON="{\"db.password\":\"DB_PWD\",\"db.host\":\"DB_HOST\",\"db.name\":\"DB_NAME\",\"db.user\":\"DB_USER\",\"aws.s3.id\":\"S3_ID\",\"aws.s3.secret\":\"S3_SECRET\",\"aws.s3.region\":\"S3_REGION\"}" \
-p 8080:8080 \
sakaba/api
curl -X POST \
-H 'Content-Type: application/json' \
-d '{"email":"example@sakaba.link", "password":"xxxx"}' \
http://localhost:8080/login
curl -X GET \
-H 'Content-Type: application/json' \
-H 'Authorization:Bearer xxxxxxxxx' \
http://localhost:8080/auth/refresh_token
curl -X GET \
-H 'Content-Type: application/json' \
-H 'Authorization:Bearer xxxxxxxxx' \
http://localhost:8080/auth/home
curl -X POST \
-H 'Authorization:Bearer xxxxxxxxx' \
-H 'Content-Type: application/json; charset=utf-8' \
-d '{ "restaurant_id": "{RESTAURANT_ID}", "genre_id": "{GENRE_ID}" }' \
http://localhost:8080/auth/restaurant-genre/
curl -X POST \
-H 'Authorization:Bearer xxxxxxxxx' \
-H 'Content-Type: application/json; charset=utf-8' \
-d '{ "url": "{URL}", "name": "{NAME}", "genre": "{GENRE}", "tel": "{TEL}", "business_day_info": "{BUSINESS_DAY_INFO}", "address": "{ADDRESS}", "latitude": "{LATITUDE}", "longitude": "{LONGITUDE}", "area": "{AREA}" }' \
http://localhost:8080/auth/restaurant/
brew install go
go install golang.org/x/lint/golint@latest
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
golint ./...
go vet ./...
shadow ./...
go env
go mod tidy -v