-
clone this repository
git clone https://github.com/raviraushanweb/bookDirectory.git
-
run below command to install the npm packages
npm install
-
create a
.env
file and add following variablesAPP_PORT=3000 DEBUG_MODE=TRUE DB_URL=<your mongodb url here> DOMAIN=<your app url or localhost url>
-
if you don't have nodemon installed, install nodemon
npm i -g nodemon
-
run the project
npm run dev
- POST : /api/addBook -- add a book
{ "title": "book15", "author": "Ravi Raushan", "publishedDate": "10/10/2020", "category": "Self Help", "pages": 123, "price": 99.99, "publication": "Pendant Pvt" }
- GET : /api/getABook/:title -- get a book by title
- GET : /api/getAllBook -- get all books
- PUT : /api/updateBook/:title -- update a book
{ "title": "book15", "author": "Ravi Raushan", "publishedDate": "10/10/2020", "category": "Self Help", "pages": 124, "price": 50, "publication": "Pendant Pvt" }
- DELETE: /api/deleteBook/:title -- delete a book