A simple RESTful API using Node.js and Express. The API manage a collection of books, supporting operations to create, read (individually/by list), update, and delete books. It provides a set of endpoints that allow you to interact with your book database.
-
Create Book: Add a new book to your collection.
-
Update Book: Modify the information of an existing book.
-
Delete Book: Delete a book from your collection.
-
Get Book: Retrieve information about a specific book or a list of all books in your collection.
POST /api/books: Create a new book.PUT /api/books/:id: Update an existing book.DELETE /api/books/:id: Delete a book by its ID.GET /api/books/:id: Get details of a specific book by its ID.GET /api/books: Get a list of all books.GET /api/books/search/:authorId: Search for books based on specific criteria (author, author city and book publish year).
To get started with the Book Management REST API, follow these steps:
Ensure git and node js are install
-
Clone this repository to your local machine:
git clone https://github.com/snython/bookManagement.git
-
Open terminal.
-
Go to the projects root directory and run the following command.
npm install
-
Define your secret key in environment variables using the command line terminal
set ACCESS_TOKEN_SECRET=your_secret_key
5. After installation is complete, you can start the REST server by running `npm start`.
NB: A postman configuration file is present in the project which could permit to do some test.