A project for CodeFellows 401 testing out an alternative to Express
- Install Node.js.
- Install MongoDB.
- Install Postman.
- Run
git clone https://github.com/YvonneHayes/hapi2.git
. - Install any dependencies/dev-dependencies according to your needs
- Use Postman to make requests.
Index page is at http://localhost:8080
Make all GET and POST requests to /books
GET, PUT, and DELETE requests can be made to /books/{id}
Request body needs to be JSON and formatted:
{"title": "Pride and Prejudice",
"author": Jane_Austen,
"done": true,
"rating": 7}
GET /books
GET /books/:id
Format:
{
title: *string*,
author: *string*,
done: *boolean*,
rating: *number*
}
"done" refers to whether you have finished reading the book and takes a boolean as a value.
- All fields are required
POST /books
Format:
{
title: *string*,
author: *string*,
done: *boolean*,
rating: *number*
}
PUT /books/:id
PATCH /books/:id
DELETE /books/:id