Movie App api application encoded with NodeJS
For Movies;
Route |
Method |
POST Body |
Description |
/api/movies |
GET |
Empty |
List all movies. |
/api/movies |
POST |
{ "title":"The Shawshank Redemption", "category":"Drama", "country":"US", "year":1994, "director_id":"60cf6158d53825d34c6c2e01", "imdb_score": 9.3} |
Create a new movie. |
/api/movies/:movie_id |
GET |
Empty |
Get a movie. |
/api/movies/:movie_id |
PUT |
{'name':'foo', 'surname':'bar'} |
Update a movie with new info. |
/api/movies/:movie_id |
DELETE |
Empty |
Delete a movie. |
/api/movies/top10 |
GET |
Empty |
Get the top 10 movies. |
/api/movies/between/ :start_year/:end_year |
GET |
Empty |
Movies between two dates. |
For Directors;
Route |
Method |
POST Body |
Description |
/api/directors |
GET |
Empty |
List all directors. |
/api/directors |
POST |
{name: 'foo', surname:'bar', bio:'lorem ipsum' } |
Create a new director. |
/api/directors/:director_id |
GET |
Empty |
Get a director. |
/api/directors/:director_id |
PUT |
{'name':'foo', 'surname':'bar', 'bio': 'lorem'} |
Update a director with new info. |
/api/directors/:director_id |
DELETE |
Empty |
Delete a director. |
/api/directors/:director_id /best10movie |
GET |
Empty |
The director's top 10 films. |
For Login;
Route |
Method |
POST Body |
Description |
/register |
POST |
{ username: 'foo', password:'1234' } |
Create a new user. |
/authenticate |
POST |
{ username: 'foo', password:'1234' } |
Generate a token. |