How it works...

Your RESTful API server will accept requests for the following paths:

  • POST/users/login: If a username does not exist in the users collection in MongoDB, an error message is sent to the client. Otherwise, it returns a welcome message.
  • POST/users/logout: This destroys the session ID.
  • POST/users/signup: This creates a new username with the defined password. However, an error will be sent to the client if the username or password does not pass the validation. It will also send an error message to the client when the username already exists.
  • GET/users/profile: If the user is logged in, the user information is sent to the client. Otherwise, an error message is sent to the client.
  • PUT/users/changepass/: This will change the current logged-in user's password. However, if the user is not logged-in, an error message is sent to the client.
  • DELETE/users/delete: This will remove a logged-in user's profile from the collection users in MongoDB. The session will be destroyed and a confirmation message is sent to the client. If the user is not logged-in, an error message is sent to the client
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.110.220