Skip to content

Creating REST API for movie using Node.js express framework.

Notifications You must be signed in to change notification settings

JaneSoo/movie-rest-api

Repository files navigation

movie-rest-api

Creating REST API for movie using Node.js express framework.

How to start the app

  • Create folder config in the root directory
  • Add file database.js inside the config directory
  • In the database.js file, add the url of the mongoose database connection similar as below (replace username, password and database name)
const DATABASECONNECTION = "mongodb+srv://<username:password>@cluster0.atx9j.mongodb.net/<database-name>?retryWrites=true&w=majority"

module.exports = { DATABASECONNECTION }
  • Run npm install and npm start or use npm run dev (to start with nodemon)

Start with docker

  • Build docker image: docker build --tag name-of-the-app .
  • Run the app with docker: docker run -it -p 3000:3000 name-of-the-app (map the available port in local machine to docker machine: 3000:3000)

When the server is up

Test the application

  • Run npm test

Note

  • In the project folder, there is movie collection ready to import to the MongoDB database
  • Also, Postman collection

About

Creating REST API for movie using Node.js express framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published