A mix of both MVC and RESTful API architecture is used in this project. The MVC architecture is used to render the views and the RESTful API architecture is used to perform CRUD operations on the book collection. While apps like this are usually built using one architecture, I wanted to try out a mix of both architectures, so this serves as a template, a good reference and learning experience for me.
# Install dependencies
npm install
# Serve on localhost:5000
npm run dev
GET /api/books
GET /api/books/:id
DELETE /api/books/:id
POST /api/books
# Request sample
{
"title": "Book Title",
"author": "Book Author",
"genre": "Book Genre"
}
PUT /api/books/:id
# Request sample
{
"title": "Updated Title",
"author": "Updated Author",
"genre": "Updated Genre"
}