A simple REST API built to try Go lang
- No third-party packages/dependencies
-
GET /books
returns list of books as JSON -
GET /books/{id}
returns details of specific book as JSON -
POST /books
to add book as JSON -
POST /books
returns status 415 if content is notapplication/json
-
PUT /books/{id}
to update a book -
DELETE /books/{id}
to delete a book
A book object should look like this:
{
"id": "someid",
"name": "name of the book",
"author": "author of the book",
"bookType": "the type of the book",
"price": 99,
}
There is no database, using the machine memory.
This lang rocks !