Route | HTTP | Header(s) | Body | Description |
---|---|---|---|---|
/books | GET | none | none | Get all Books success: (200), example: [{"_id: String", "isbn": String, "title": String, "author": String, "category": String, "stock": Number}, {"id: String", "isbn": String, "title": String, "author": String, "category": String, "stock": Number}, etc] errors: (500), error |
/books/:id | GET | none | none | Get book by id success: (200), example: {"_id: String", "isbn": String, "title": String, "author": String, "category": String, "stock": Number} errors: (404), example: {"message": "Book not found"} (500), error |
/books | POST | none | isbn:String, title:String, author:String, category:String, stock:Number |
Add a book success: (200), example: {"_id: String", "isbn": String, "title": String, "author": String, "category": String, "stock": Number} errors: (500), error |
/books/:id | PUT | none | none | Update a book with new values success: (200), example: {"n": 1, "ok": 1} errors: (404), example: {"message": "Book not found"} (500), error |
/books/:id | DELETE | none | none | Delete a book success: (200), example: {"n": 1, "ok": 1} errors: (404), example: {"message": "Book not found"} (500), error |
forked from mhmmd-ysf/mongodb-crud
-
Notifications
You must be signed in to change notification settings - Fork 0
willyprayogo26/mongodb-crud
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- JavaScript 100.0%