- Docker
- Golang v1.14+
-
Export DB_PASSWORD
export DB_PASSWORD="S3cretP@ssw0rd"
-
Bring up the mysql container using:
make infra-local
- Run the migrations on the local DB
make setup
- Build and run the app container.
make app
- Inspect logs using docker
docker logs event-history-go -f
Create key Request
curl -X POST 'http://localhost:8080' \
--header 'Content-Type: application/json' \
--data-raw '{
"key": "name",
"user_id": "user1",
"value": "john"
}'
Update key Request
curl -X PUT 'http://localhost:8080/' \
--header 'Content-Type: application/json' \
--data-raw '{
"key": "name",
"user_id": "user1",
"value": "Sam"
}'
GET historised answer Req
curl -X GET 'http://localhost:8080/user1/name'
GET latest answer Req
curl -X GET 'http://localhost:8080/latest/user1/name'
Delete key Req
curl -X DELETE 'http://localhost:8080/user1/name'