This is a Movie Application that allows users to view, add, edit, and delete movies. The project is built using Node.js and Express framework, and it uses MongoDB as the database to store movie information.
- Install MongoDb On your system
- Clone the repository:
git clone https://github.com/abtinokhovat/movie-application-nodejs-course.git
- Install dependencies:
npm install
- Open the
config.js
file and update the MongoDB connection URL if necessary.
- Start the application:
npm start
- Access the application at
http://localhost:3000
- Description: Fetches all movies
- Response Format: JSON
- Example Response:
[ { "title": "The Shawshank Redemption", "director": "Frank Darabont", "genre": "Drama", "imageUrl": "https://example.com/poster.jpg", "year": 1994 }, { "title": "The Godfather", "director": "Francis Ford Coppola", "genre": "Crime", "imageUrl": "https://example.com/poster.jpg", "year": 1972 } ]
- Description: Adds a new movie
- Request Format: JSON
- Example Request:
{ "title": "Inception", "director": "Christopher Nolan", "genre": "Sci-Fi", "imageUrl": "https://example.com/poster.jpg", "year": 2010 }
- Response Format: JSON
- Example Response:
{ "title": "Inception", "director": "Christopher Nolan", "genre": "Sci-Fi", "imageUrl": "https://example.com/poster.jpg", "year": 2010 }
- Description: Updates an existing movie
- Request Format: JSON
- Example Request:
{ "title": "Inception", "director": "Christopher Nolan", "genre": "Sci-Fi/Thriller", "imageUrl": "https://example.com/poster.jpg", "year": 2010 }
- Response Format: JSON
- Example Response:
{ "title": "Inception", "director": "Christopher Nolan", "genre": "Sci-Fi/Thriller", "imageUrl": "https://example.com/poster.jpg", "year": 2010 }
- Description: Deletes a movie
- Response Format: JSON
- Example Response:
{ "message": "Movie deleted successfully" }
app.js
: Entry point of the applicationconfig.js
: Configuration fileroutes/movies.js
: Movie routes definitionmodels/movie.js
: Movie model definition
- Express: Fast, unopinionated, minimalist web framework for Node.js
- Mongoose: Elegant MongoDB object modeling for Node.js
This project is licensed under the MIT License.