Clone This Repo
git clone https://github.com/ra463/Digital.git
Create a file named config.env
in the config
folder and add the following env variable
JWT_SECRET="Your Random JWT Secret"
JWT_EXPIRE="Random days to expire JWT Token"
PORT=4000(Or any port of your choice)
MONGO_URI="Your MongoDB Atlas/local Url to connect to database"
Install all the dependencies by running the command npm install
To run this project simply run the command npm run dev
There are 2 types of Routes:
- User
- Book
B_URL = http://localhost:4000/api/user
- Register - B_URL/register (Register User)
POST
- Login - B_URL/login (Login User)
POST
- My Profile - B_URL/myprofile (Get My profile)
GET
- Update Password - B_URL/update-password
PATCH
- Update Details - B_URL/update-details
PATCH
B_URL = http://localhost:4000/api/book
- Add Book - B_URL/add-book (Admin can add Book)
POST
- Update Book - B_URL/update-book (Update Book Detals)
POST
- Delete Book - B_URL/delete-book/:id
DELETE
- Get All Books - B_URL/get-all-books
GET
- Get Book By Id - B_URL/get-book/:id
GET
For role = Admin
pls change the role of user manually after registering user from database