A simple RESTful API for managing a collection of books, allowing users to perform basic CRUD (Create, Read, Update, Delete) operations. This project was developed as a final submission for the "Belajar Membuat Aplikasi Back-End untuk Pemula" (Learning to Build a Back-End Application for Beginners) course on the Dicoding platform.
The application is built with vanilla Node.js and the Hapi.js framework, with data being stored in-memory in a local array (no database).
- Add a New Book: Save a new book with details like title, author, and summary.
- Get All Books: Retrieve a list of all saved books.
- Get Book by ID: Fetch the details of a specific book using its unique ID.
- Update Book Data: Modify the information of an existing book.
- Delete a Book: Remove a book from the collection.
- Query Parameters: Filter the book list based on
name,readingstatus, orfinishedstatus.
- Runetime Environtment: Node.js
- Web Framework: Hapi.js
- Unique ID Generation: nanoid
- Code Linter: ESLint
- Development Tools: Nodemon
Follow these steps to get the project running on your local machine.
- Clone the repository:
git clone https://github.com/Huseinaby/Bookshelf-API.git cd Bookshelf-API - Install dependencies:
npm install
- Run server:
The API will be available at
npm run start
http://localhost:5000.
| Method | Endpoint | Description |
|---|---|---|
POST |
/books |
Add New Book |
GET |
/books |
Get All Books |
GET |
/books/{id} |
Get Book by ID |
PUT |
/books/{id} |
Update Book by ID |
DELETE |
/books/{id} |
Delete Book by ID |