Question: 1. Create a new account with MongoLab and create a new MongoDB Deployment and set the plan to sandbox: Reference: CRUD Lab 2. Create a
1. Create a new account with MongoLab and create a new MongoDB Deployment and set the plan to sandbox: Reference: CRUD Lab
2. Create a registration.html page and put it in your static folder. The page should contain the following fields: Firstname Lastname Email Create a link on your login page to register and return this page when clicked.
3. When the submit button is pressed on your registration form, retrieve the form data and save it in your mongodb. Add a random number for customer id and add a password of welcome1.
4. Modify your code that handles your login route to retrieve the user matching the email entered in the username field from the mongodb and check the password from the actual value in the mongodb.
5. Add a reset password link to your login form. When clicked, the user should be taken to a reset.html page. This page should have the following fields: Email Old Password New Password When submitted, the corresponding route should retrieve the user for that email from the mongodb and if the old password matches, it should update the customer object with the new password.
6. Create a script called cart_init.js in the root directory of your project. In this script, create several fake album objects that contain the album name, artist and price and store them in your mongodb. You can run this and add fake products to your db. Modify the route that corresponds to the GET method and /products to retrieve a list of albums from the mongodb and display them on a products page. You can use ejs for this.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
