https://github.com/blevs/http-movies-recitation
https://github.com/blevs/http-movies-recitation
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/blevs/http-movies-recitation
- Owner: Blevs
- Created: 2019-08-23T01:30:59.000Z (almost 7 years ago)
- Default Branch: shared-state
- Last Pushed: 2023-01-04T07:55:07.000Z (over 3 years ago)
- Last Synced: 2023-03-03T18:39:13.375Z (over 3 years ago)
- Language: JavaScript
- Size: 2.08 MB
- Stars: 2
- Watchers: 2
- Forks: 4
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HTTP Movies - Stretch Assignment
## Instructions
- **Fork** this repository, then clone your fork.
- Run `yarn` to download dependencies.
- Run the server using `yarn start` or `node server.js`.
- In a separate terminal cd into the `client` folder and run `yarn install` to download dependencies.
- Still inside the `client` folder run `yarn start` to run the client application.
### Part 1 - Updating A Movie:
- Add a route at the path `/update-movie/:id`
- Create a component with a form to update the chosen movie
- Add a button in the movie component that routes you to your new route with the movies's id as the URL param
- The form should make a PUT request to the server when submitted
- When the call comes back successfully, reset your form state and route the user to `/movies` where they will see the updated movie in the list
Movie object format:
```
{
id: 5,
title: 'Tombstone',
director: 'George P. Cosmatos',
metascore: 89,
stars: ['Kurt Russell', 'Bill Paxton', 'Sam Elliot'],
}
```
### Part 2 - Deleting A Movie:
- Add a delete button in the movie component that makes a DELETE request
- When the call comes back successfully, route the user to `/movies` where they will see the updated movie list without the deleted movie
### Part 3 (Stretch) - Adding A Movie:
- Add a route at the path `/add-movie`
- Create a component with a form to add a new movie
- Each created movie should have the following format (notice the array of strings - this will test your JS skills, so work through it methodically)
- The form should make a POST request to the server when submitted
- When the call comes back successfully, reset your form state and route the user to `/movies`
Movie object format:
```
{
id: 5,
title: 'Tombstone',
director: 'George P. Cosmatos',
metascore: 89,
stars: ['Kurt Russell', 'Bill Paxton', 'Sam Elliot'],
}
```
## Stretch Problem
- See Part 3 above (Adding movies with a POST request)
- Style the app!