Skip to content

Dani-Bcn/movies-rest-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Movie REST API

Description

This is a the backend repository for a React application about a user's favorite movies.


Instructions

⚠️ When cloning the project, change the sample.env file name for .env ⚠️. The project will run on PORT 8000.

Then, run:

npm install
  • To start the project run:
npm run start
  • To start the project in development mode, run:
npm run dev
  • To seed the database, run:
npm run seed

Models

Movie

When retrieving data from the API, every movie will have the following properties:

{
  "title": "Home Alone"
  "year": 1990,
  "director": "Chris Colombus",
  "duration": 103,
  "synopsis": "A kid is left alone at home while his family travels to Paris for Christmas. He then has to face two burglars with much creativity.",
  "image": "https://m.media-amazon.com/images/I/81EWrTadiJL._AC_SY679_.jpg"
}

API endpoints and usage

Action Method Endpoint Req.body
GET all movies GET /api/v1/movies No
GET single movie GET /api/v1/:movieId No
CREATE a movie POST /api/v1/movies Yes
DELETE a movie DELETE /api/v1/:movieId No
EDIT a movie PUT /api/v1/:movieId Yes

Tasks ✅

  • Create the model Movie
  • Create all the routes to be able to read, create, edit and delete movies and test them out with Postman
  • Create an array of 4 movies of your own choosing and seed the database with them. Then, test on Postman if they have been created.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%