-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.txt
executable file
·95 lines (77 loc) · 2.23 KB
/
routes.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Base URL: http://localhost:5000/api/
============== User Routes ==============
1. Create User
path: '/user/register',
req.data: body {username, email, password},
res: new user details
2. Login User
path: '/user/login',
req.data: body{username, password},
res: userInfo, token
3. Forgot Password
path: '/userforgotpassword',
req.data: body{email},
res: [
{
status: 404,
message: "User does not exist! Please create new user."
},
{
status: 500,
message: "Could not send the mail!"
},
{
status: 200,
message: "mail has been sent!"
}
]
4. Update User
path: '/user/update/:id',
req.data: auth-token, req.body.userId (user_id), req.param.id (user_id), req.body.password,
res: updatedUser
5. Delete User
path: '/user/delete/:id',
req.data: req.body.userId (user_id), req.param.id (user_id), auth-token, req.body.username,
res: username
6. Get Single User
path: '/user/:id',
req.data: req.param.id (user_id),
res: user
============== Admin Routes ==============
1. Create Admin
path: '/admin/register',
req.data: body.username, body.email, body.password,
res: new admin-user details
2. Login Admin
path: '/admin/login',
req.data: username(admin), password,
res: adminInfo, token
3. Update Admin
path: '/admin/update/:id',
req.data: auth-token, body{userId (user_id), username, password}, params{userId (user_id)},
res: updatedAdmin
4. Delete Admin
path: '/admin/delete/:id',
req.data: auth-token, body{userId (user_id), username, password}, params{userId (user_id)},
res: username
5. Get Single Admin-User
path: '/admin/:id',
req.data: req.param.id (user_id),
res: admin-user
============== Articles Routes ==============
1. Create Article
path: '/articles/create',
req.data: auth-token, body{author, authorId, role, title, content, tags, image}
res: new article
2. Update Article
path: '/articles/update/:id',
req.data: auth-token, body{authorId, author}, params{articleid (article_id)}, article_details_to_change{title, content, tags},
res: updated article
3. Delete Article
path: '/articles/delete/:id',
req.data: auth-token, body{userId (user_id), author, articleId}, params{articleId} ,
res: new article
4. Get Single Article
path: '/articles/:id',
req.data: params{articleId},
res: article