Skip to content

carl-st/Cinenode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cinenode CircleCI

Example of a simple Node.js application with Express and MongoDB.

App is hosted on Heroku

Setup

Make sure you have the newest Node and NPM already installed.

Dependencies installation

$ npm install

Build application

$ npm run grunt

Start Express back-end

$ npm start

Other commands

Start and watch application using nodemon in dev environment

$ npm run dev

Run tests

$ npm test

Setting default environment

See config.json and set the ENV field to development, testing or production.

Endpoints and functionality

  • POST /movies
    • Based on passed title, all movie details are fetched from OMDb API and saved to application database.
    • Request body: { "title": string }
  • GET /movies
    • Fetches list of all movies already present in application database.
    • Optional params: sortby = string, desc = boolean
  • POST /comments
    • Adds a comment to given movie id
    • Request body: { "movie": string, "content": string }
  • GET /comments
    • Fetches list of all comments present in application database
  • GET /comments/movie
    • Fetches list of all comments for given movie id.
    • Params: id = string