You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user creates an account using the sign up form, we want the user to be created in our MongoDB database.
Make an API endpoint that takes in user data from the sign up form and creates the user. We don’t want to create duplicate users so if the email or username already exists in the database, display an error message to the console instead of creating a new user. For the isAdmin field, for now just hard-code it to be false. Don’t worry about authentication, we’ll be working on it in future sprints with Clerk!
Task Description:
When a user creates an account using the sign up form, we want the user to be created in our MongoDB database.
Make an API endpoint that takes in user data from the sign up form and creates the user. We don’t want to create duplicate users so if the email or username already exists in the database, display an error message to the console instead of creating a new user. For the isAdmin field, for now just hard-code it to be false. Don’t worry about authentication, we’ll be working on it in future sprints with Clerk!
References and Resources:
Express docs: https://expressjs.com/en/guide/routing.html
Mongoose docs: https://mongoosejs.com/docs/
MongoDB collection commands: https://www.mongodb.com/docs/manual/reference/method/js-collection/
Using Express with MongoDB and Mongoose: https://dev.to/franciscomendes10866/setup-mongodb-with-mongoose-and-express-4c58
Async/await: https://medium.com/@Abazhenov/using-async-await-in-express-with-node-8-b8af872c0016
(Optional but helpful for debugging): https://apidog.com/blog/how-to-use-postman-for-api-testing/
Acceptance Criteria:
The text was updated successfully, but these errors were encountered: