Golang workshop to demonstrate how to create REST API.
API endpoints:
- Home -
GET /
- Health - homework (returns
200
in case Redis connection established othervise returns503
) - GetBooks - homework
- GetBook -
GET /book/{id}
- CreateBook -
POST /book
- DeleteBook - homework
-
Run server
docker-compose up --build -d
-
Create book
curl -XPOST "http://0.0.0.0:3000/book" --data '{"id": "123", "title":"MegaBook"}' -v
-
Get book
curl "http://0.0.0.0:3000/book/123"