Customer Details APIs Using Node.js, MySQL and JWT
HTML form:
On Submit -> Redirected to /users/all
• /details
Structure: BASE_URL/details/${user_id}
Returns: object:{...user_details}
• /update
Structure: BASE_URL/update
Request Body: object:{...new_details_of_user}
Returns: Some kind of a success or failure message for acknowledgement
-
Update without login: Fails with error message “No token provided!”
-
Update with Login: Using username and password generates unique access token, valid for 24hrs.
- Adding access token to header
- Updating total orders
• /image
Structure: BASE_URL/image/${user_id}
Returns: object:{...user_image}
• /insert
Structure: BASE_URL/insert
Request Body: object:{user_details}
Returns: Some kind of success or failure message
- Creating a new user: Get Success message
• /delete
Structure: BASE_URL/delete/${user_id}
Returns: A success or failure message