Final project for developing back-end apps with Node.js and Express
- JavaScript
- Node.js
- Express.Js
- NPM
- MongoDB & Mongoose
-
Authentication
- User can create an account with email.
- Passwords are encrypted.
- Each user has JWT.
-
Authorization
- Only authenticated users are authorized to perform the operations.
- Only Admin can add new books.
-
MongoDB & Mongoose
- All data are stored in mongodb
-
Error Handling
- A global error handling function has been implemented in this project.
-
MVC
Method | URI | Action |
---|---|---|
POST |
api/user/ |
\Controllers\authController@signUp |
POST |
api/user/login |
\Controllers\authController@login |
Method | URI | Action |
---|---|---|
GET |
api/book/ |
\Controllers\bookController@getAllBooks |
POST |
api/book/add/ |
\Controllers\bookController@addBook |
Method | URI | Action |
---|---|---|
GET |
api/book/:id/review/ |
\Controllers\reviewController@getAllReviews |
POST |
api/book/:id/review/ |
\Controllers\reviewController@addReview |
PUT |
api/book/:id/review/ |
\Controllers\reviewController@updateReview |
DELETE |
api/book/:id/review/ |
\Controllers\reviewController@deleteReview |