Example of a simple Node.js application with Express and MongoDB.
App is hosted on Heroku
Make sure you have the newest Node and NPM already installed.
$ npm install
$ npm run grunt
$ npm start
$ npm run dev
$ npm test
See config.json
and set the ENV
field to development
, testing
or production
.
- 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