This project is a library management API that provides three main endpoints:
- Get All Books: Retrieve a list of all books in the library.
- Add a Book: Add a new book to the library.
- Update a Book: Update the details of an existing book in the library with book ID.
To run this project, follow these steps:
- Clone the repository to your local machine:
clone this repo
- Navigate to the project directory:
cd "to repo"
- Install the project dependencies:
npm install
- Set the .env file with correct Mongodb URL:
rename the .env.example file to .env and complete the mongodb URL there
- Start the server:
node app.js
- Once the server is running, you can access the API endpoints using the following URLs:
- Get All Books (GET):
http://localhost:5000/api/books
- Add a Book (POST):
http://localhost:5000/api/books
- Update a Book (PUT):
localhost:5000/api/books/:id
Replace :id
with the ID of the book you want to update.
That's it! You should now be able to run and use the Library Management API. Happy coding!