-
Notifications
You must be signed in to change notification settings - Fork 0
/
rest.html
86 lines (84 loc) · 1.94 KB
/
rest.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
<!DOCTYPE html>
<html>
<head>
<title>RESTful Routes</title>
<!-- <link rel="stylesheet" type="text/css" href="bootstrap.css"> -->
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-lg-1"></div>
<div class="col-lg-10">
<div class="jumbotron">
<h1>RESTful Routes</h1>
<p>A table of all 7 RESTful routes </p>
</div>
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Path</th>
<th>HTTP Verb</th>
<th>Purpose</th>
<th>Mongoose Method</th>
</tr>
</thead>
<tbody>
<tr>
<td>Index</td>
<td>/dogs</td>
<td>GET</td>
<td>List all dogs</td>
<td>Dog.find()</td>
</tr>
<tr class="success">
<td>New</td>
<td>/dogs/new</td>
<td>GET</td>
<td>Show new dog form</td>
<td>N/A</td>
</tr>
<tr class="success">
<td>Create</td>
<td>/dogs</td>
<td>POST</td>
<td>Create a new dog, then redirect somewhere</td>
<td>Dog.create()</td>
</tr>
<tr class="info">
<td>Show</td>
<td>/dogs/:id</td>
<td>GET</td>
<td>Show info about one specific dog</td>
<td>Dog.findById()</td>
</tr>
<tr class="warning">
<td>Edit</td>
<td>/dogs/:id/edit</td>
<td>GET</td>
<td>Show edit form for one dog</td>
<td>Dog.findById()</td>
</tr>
<tr class="warning">
<td>Update</td>
<td>/dogs/:id</td>
<td>PUT</td>
<td>Update particular dog, then redirect somewhere</td>
<td>Dog.findByIdAndUpdate()</td>
</tr>
<tr class="danger">
<td>Destroy</td>
<td>/dogs/:id</td>
<td>DELETE</td>
<td>Delete a particular dog, then redirect somewhere</td>
<td>Dog.findByIdAndRemove()</td>
</tr>
</tbody>
</table>
</div>
<div class="col-lg-1"></div>
</div>
</div>
</body>
</html>