-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrompts-BackEnd.txt
31 lines (19 loc) · 1.36 KB
/
Prompts-BackEnd.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Write javascript code to create an express server. It should allow CORS requests
CORS request should be allowed from all domains
Use bodyparser in code to parse request bodies
database service located on http://localhost:3306
make an api endpoint to add users to database named ecommerce.users should be added to table users.schema is as follows:-
username varchar(255)
password varchar(255)
phoneNo integer,
userType varchar(255)
add exception handling to db.connect statementThe catch block should describe the exact error
getting issue with catch as catch is undefined
Add error handling for db.query statement
implement an api call to login users.
create an api call to check if given username and given password exist in single row in table users. If yes then send a response of success else send a response of login failue
implement error handling for the sql query
Write an API end point for password change. The user table contains email,phone and password. Request body will contain email oldPassword and new password. Check is old password is correct
Use nodemailer to send mail
Create an API endpoint for forgot password. Here password should be reset, updated in database and reset password must be sent via mail. Request body will contain mail. Database used in mysql database. Table is users, with columns email and password
Set unit test cases for back-end/index.js