-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
160 lines (153 loc) · 7.31 KB
/
index.html
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>API's List</title>
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
<div class="container">
<h1>Welcome</h1>
<p class="lead">Here are the API's provided by this server</p>
<div class="panel-group">
<div class="panel panel-success">
<div class="panel-heading">
<a class="panel-title" href="#getUserInfo" data-toggle="collapse" data-parent=".panel-group">
getUserInfo <span class="caret"></span>
</a>
</div>
<div id="getUserInfo" class="panel-collapse collapse in">
<table class="table table-bordered table-hover">
<colgroup>
<col class="col-md-3">
<col class="col-md-5">
</colgroup>
<tbody>
<tr>
<th scope="row">Description</th>
<td>Gets the user info, matching the name.</td>
</tr>
<tr>
<th scope="row">URL</th>
<td>/api/getUserInfo/<b><name></b></td>
</tr>
<tr>
<th scope="row">HTTP Method</th>
<td>GET</td>
</tr>
<tr>
<th scope="row">Format</th>
<td>Plain Text</td>
</tr>
<tr>
<th scope="row">Example of GET request</th>
<td>/api/getUserInfo/Ingrid</td>
</tr>
<tr>
<th scope="row">Returns status 200 for OK, 400 for bad request and 500 for server error; plus the user info
OR a message indicating what went wrong.</th>
<td>
<code>{ "name": "Ingrid", "age": 30, "city": "Paris" }</code>
<br/><code>{ "Error": "failed to connect to server on first connect" }</code>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading">
<a class="panel-title" href="#addOrUpdateUser" data-toggle="collapse" data-parent=".panel-group">
addOrUpdateUser <span class="caret"></span>
</a>
</div>
<div id="addOrUpdateUser" class="panel-collapse collapse">
<table class="table table-bordered table-hover">
<colgroup>
<col class="col-md-3">
<col class="col-md-5">
</colgroup>
<tbody>
<tr>
<th scope="row">Description</th>
<td>Adds or updates a user, matching the name.</td>
</tr>
<tr>
<th scope="row">URL</th>
<td>/api/addOrUpdateUser</td>
</tr>
<tr>
<th scope="row">HTTP Method</th>
<td>POST</td>
</tr>
<tr>
<th scope="row">Format</th>
<td>JSON</td>
</tr>
<tr>
<th scope="row">Example of POST payload</th>
<td><code>{ "name": "Jon", "age": 40, "city": "London" }</code></td>
</tr>
<tr>
<th scope="row">Returns status 200 for OK, 400 for bad payload and 500 for server error; plus a message indicating
what happened</th>
<td>
<code>{ "result": "User added successfully" }</code>
<br/><code>{ "result": "User updated successfully" }</code>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-danger">
<div class="panel-heading">
<a class="panel-title" href="#deleteUser" data-toggle="collapse" data-parent=".panel-group">
deleteUser <span class="caret"></span>
</a>
</div>
<div id="deleteUser" class="panel-collapse collapse">
<table class="table table-bordered table-hover">
<colgroup>
<col class="col-md-3">
<col class="col-md-5">
</colgroup>
<tbody>
<tr>
<th scope="row">Description</th>
<td>Deletes the user, matching the name.</td>
</tr>
<tr>
<th scope="row">URL</th>
<td>/api/deleteUser/<b><name></b></td>
</tr>
<tr>
<th scope="row">HTTP Method</th>
<td>DELETE</td>
</tr>
<tr>
<th scope="row">Format</th>
<td>Plain Text</td>
</tr>
<tr>
<th scope="row">Example of DELETE request</th>
<td>/api/deleteUser/Ingrid</td>
</tr>
<tr>
<th scope="row">Returns status 200 for OK, 400 for bad request or if the user was already gone and 500 for
server error; plus a message indicating what happened.</th>
<td>
<code>{ "result": "User deleted successfully" }</code>
<br/><code>{ "result": "User was already gone" }</code>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
</body>
</html>