Go version > 1.23.5
Run tests:
$ go test ./...Edit config.json
{
"validApiKeys": {
"abc123": "dev",
"def456": "prod"
}
}Deploy server and database
$ docker compose upAdds a new book to the database.
- The request must contain a valid JSON payload.
{
"title": "Confederacy of Dunces",
"author": "John Kennedy Toole",
"year": 1980,
"publisher": "Louisiana State University",
"readtime": "2023-11-24",
"rating": 4,
"comments": "",
"language": "English",
"genre": "Satire",
"isbn": "0-8071-0657-7"
}Returns a list of all books.
[
{
"id": "1",
"title": "Foo Bar",
"author": "Foo"
},
{
"id": "2",
"title": "Confederacy of Dunces",
"author": "John Kennedy Toole"
}
]Returns a book by its unique identifier.
:idis the unique book ID.
{
"id": "1",
"title": "Foo Bar",
"author": "Foo",
"year": 2021,
"publisher": "Example Publisher",
"readtime": "2023-12-10",
"rating": 5,
"comments": "Great read!",
"language": "English",
"genre": "Fiction",
"isbn": "123-456-789"
}Deletes a book from the database.
:id is the unique book ID.