Ron Reciproco 4b003da8da | 1 year ago | |
---|---|---|
.. | ||
controllers | 1 year ago | |
model | 1 year ago | |
routes | 1 year ago | |
.env | 1 year ago | |
.gitignore | 1 year ago | |
.prettierrc | 1 year ago | |
Procfile | 1 year ago | |
auth.js | 1 year ago | |
index.js | 1 year ago | |
package-lock.json | 1 year ago | |
package.json | 1 year ago | |
readme.md | 1 year ago |
readme.md
**** Accounts ****
User: ( Password: wapatu ) { "userId": "65544d9be5c01f6c0ca79200", "email": "wapatu@example.com", "firstName": "Estevan", "lastName": "Cummings", "isAdmin": false, "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NTU0NGQ5YmU1YzAxZjZjMGNhNzkyMDAiLCJlbWFpbCI6IndhcGF0dUBleGFtcGxlLmNvbSIsImlzQWRtaW4iOmZhbHNlLCJpYXQiOjE3MDAwMjM3MjQsImV4cCI6MTcwMDAyNzMyNH0.dpWV9Zx64TH4RLgmV_RlyrMBCa0HwDe9wJRAkwAyjys" }
Admin: (Password is: admin ) { "userId": "65535cb526b586a3e2fd56cc", "email": "admin@email.com", "isAdmin": true, "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NTUzNWNiNTI2YjU4NmEzZTJmZDU2Y2MiLCJlbWFpbCI6ImFkbWluQGVtYWlsLmNvbSIsImlzQWRtaW4iOnRydWUsImlhdCI6MTcwMDAyMzgxMSwiZXhwIjoxNzAwMDI3NDExfQ.DrhpNlBJKpfHod7MfTalQ5j2-s8tnR630yh2-_EIYWw" }
**** Links ****
REGISTER http://localhost:3000/user/register --> Use post { "email": "admin@email.com", "password": "admin" }
LOGIN http://localhost:3000/user/login --> Use post { "email": "admin@email.com", "password": "admin" }
UPDATE PROFILE http://localhost:3000/user/update --> Must use Admin token // use put { "userId": "6554473388d9942bbf4de065", "newEmail": "mundo@email.com", "newFirstname": "Ron", "newLastName": "Pogi", "newPassword": "mundo" }
CREATE PRODUCT [ADMIN] http://localhost:3000/user/products --> Must use Admin token // use post { "name": "Poring Card", "description": "Description unknown", "price": 500 }
GET ALL PRODUCT http://localhost:3000/user/all --> Use get
GET ALL ACTIVE PRODUCT http://localhost:3000/user/active --> Use get
GET A SINGLE PROUCT http://localhost:3000/user/products/65538bd4a601aa30730f6d4c --> Use get
UPDATE A PRODUCT [ADMIN] http://localhost:3000/user/products/65545a1e6fa9d841e1518d1d --> Must use Admin token // Use put { "name": "Christmas Cookie Card", "description": "Updated Product Description", "price": 29.99, "isActive": false }
ACTIVATE / ARCHIVE A PRODUCT [ADMIN] --> Use Put http://localhost:3000/user/products/6554634e5cac4bcd6f2394ed/activate http://localhost:3000/user/products/6554634e5cac4bcd6f2394ed/archive
RETRIEVE OWN USER DATA --> Use Get http://localhost:3000/user/65535cb526b586a3e2fd56cc