-
Notifications
You must be signed in to change notification settings - Fork 0
/
task.txt
51 lines (29 loc) · 1.25 KB
/
task.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
creating REST API using express
follow this steps to setup..
1. Install node.js & Fetch the github repo
2. intsll npm
3. npm install
4. npm start
GET /users - HTML Document render --done
GET /api/users - List all users as json --done
// using Dynamic path routs
GET /api/users/:id
GET /api/users/1 - Get the user with id 1 --done
// for patch delete will use postman
POST /api/users - create new user
PATCH /api/users/1 - Edit the user with ID 1
DELETE /api/users/1 - Delete the user with ID 1
then we will going to create cookie, but
storing data(in form of cookie) on client server is not good idea.
so I will session to store data on server side.
// api/users/added - to see requests sent by user
// api/users/adding - to sent the requests
created feture - to use apis user should be authenticate first
we are also creating authentication route to signup and signin
/auth/login - to login
/auth/register - to register
we are encrypting password by using the bcrypt module. once hasing of the password done so we cant get back
users normal password so it is very useful to secure our data.
after learning basics I have implemented passport.js in my project for authenticate.
we will user mockaroo for the generating fake data.
https://www.mockaroo.com/