-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocumentation.html
170 lines (166 loc) · 7.42 KB
/
documentation.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
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Documentation</title>
<style>
th { padding-right: 50px; border-bottom: 2px solid black; border-right: 2px solid black; }
td { border-bottom: 2px solid black; padding-right: 50px; padding-bottom: 20px; border-right: 2px solid black; }
</style>
</head>
<body>
<h1>
Movie-Flix Documentation
</h1>
<p>
This web application will provide users with access to information about different movies, directors, and genres.
Users will be able to sign up, update their personal information, and create a list of their favorite movies.
</p>
<div>
<table>
<thead>
<tr>
<th>Business Logic</th>
<th>URL</th>
<th>HTTP Method</th>
<th>Request body data format</th>
<th>Response body data format</th>
</tr>
</thead>
<tbody>
<tr>
<td>Login to user<br>Must login to access the API</td>
<td>/login</td>
<td>POST</td>
<td>Params of<br>Username: "username"<br>Password: "password"</td>
<td>A JSON object holding data about logged in user<br>
Returns info about signed in user<br>
{<br>"user":{ User Info },<br>"token": "your-token"<br>}
</td>
</tr>
<tr>
<td>Get a list of movies</td>
<td>/movies</td>
<td>GET</td>
<td>NONE</td>
<td>A JSON array holding data about all the movies<br>
Returns an array of movies<br>
[] Movies
</td>
</tr>
<tr>
<td>Get info by Movie<br>Description, Genre, Director, Cover-art</td>
<td>/movies/:Title</td>
<td>GET</td>
<td>NONE</td>
<td>A JSON object holding data about the movie<br>
Returns an object about the movie<br>
{<br>Title: string, <br>Description: string, <br>Released: string, <br>Genre: []string, <br>Director: []string, <br>ImagePath: string<br>Featured: boolean<br>}
</td>
</tr>
<tr>
<td>Get a list of Genres</td>
<td>/genres</td>
<td>GET</td>
<td>NONE</td>
<td>A JSON array holding data about all Genre<br>
Returns a array of Genre<br>
[] Genres
</td>
</tr>
<tr>
<td>Get Genre by Name<br>Horror, Action, Sci-fi</td>
<td>/genres/:Name</td>
<td>GET</td>
<td>NONE</td>
<td>A JSON object holding data about chosen Genre<br>
Returns a object about Genre<br>
{<br>Name: string, <br>About: string<br>}
</td>
</tr>
<tr>
<td>Get a list of Directors</td>
<td>/directors</td>
<td>GET</td>
<td>NONE</td>
<td>A JSON array holding data about all Directors<br>
Returns a array of Directors<br>
[] Directors
</td>
</tr>
<tr>
<td>Get Director by Name<br>example: Ridley Scott</td>
<td>/directors/:Name</td>
<td>GET</td>
<td>NONE</td>
<td>A JSON object holding data about chosen directors name<br>
Returns a object about the director<br>
{<br>Name: string,<br>Bio: string,<br>Born: intiger,<br>Dead: string<br>}
</td>
</tr>
<tr>
<td>Allow new users to register</td>
<td>/users</td>
<td>POST</td>
<td>A JSON object holding data about the user to add.<br>Structured like:<br>
{<br>"Username": "Billy",<br>"Password": "secure123",<br>"Email": "[email protected]",<br>"FavoriteMovies": [],<br>"Birthday": "YYYY-MM-DD"<br>}
</td>
<td>A text message indicating whether the user was successfully created or not<br>
Message: "Billy" was added
</td>
</tr>
<tr>
<td>Get user by username</td>
<td>/users/:Username</td>
<td>GET</td>
<td>Authorize your token
</td>
<td>A JSON object holding data about user<br>
Returns an object about the user<br>
{<br>"Username": "Billy",<br>"Password": "secure123",<br>"Email": "[email protected]",<br>"FavoriteMovies": [],<br>"Birthday": "YYYY-MM-DD"<br>}
</td>
</tr>
<tr>
<td>Allow users to update their user info</td>
<td>/users/:Username</td>
<td>PUT</td>
<td>Authorize your token<br>A JSON object holding data about the user update.<br>Structured like:<br>
{<br>"Username": "Billy G",<br>}
</td>
<td>A JSON object holding data about updated user:<br>
{<br>"Username": "Billy G",<br>"Password": "secure123",<br>"Email": "[email protected]",<br>"FavoriteMovies": [],<br>"Birthday": "YYYY-MM-DD"<br>}
</td>
</tr>
<tr>
<td>Allow users to add a movie to their<br>list of favorites</td>
<td>/users/:Username/movies/:MovieID</td>
<td>POST</td>
<td>Authorize your token</td>
<td>A text message indicating whether the favorite movie was added or not<br>
Message: Movie added to Favorites
</td>
</tr>
<tr>
<td>Allow users to Remove a movie from their<br>list of favorites</td>
<td>/users/:Username/movies/:MovieID</td>
<td>DELETE</td>
<td>Authorize your token</td>
<td>A text message indicating whether the favorite movie was removed or not<br>
Message: Movie removed from Favorites
</td>
</tr>
<tr>
<td>Allow existing users to deregister</td>
<td>/users/:Username</td>
<td>DELETE</td>
<td>Authorize your token</td>
<td>A text message indicating whether the user was removed or not<br>
Message: "Willy" was deleted
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>