- Node.js
- Express.js
- Axios Promise based HTTP client
- eslint code linting
- pm2 Nodejs production process manger
- git
- node.js >=6.10.0
$ export NODE_ENV=developement/qa/production
$ npm install
$ npm start
Using pm2 start server with 'cluster' mode
$ npm run start:prod
server will start at http://localhost:3000
- fetch movies and characters from swapico
- using https://swapi.co resources to fetch movies and characters from the below resources
- fetch /films, /people for the first time and store it in the cache (in memory) and from the second time retrieve from the cache, for production ready replace in momery cache with distributed cache
api resource base path http://localhost:3000/api
-
GET /movies : get movies - http://localhost:3000/api/movies
-
GET /movies/{id}/characters : get movie characters - http://localhost:3000/api/movies/{id}/characters
-
GET /movies
- response
[ { "id", "<movie id>", "name": "<movie name/title>", "director": "<director name>" }, { ... }, { ... }, { ... } ]
-
GET /movies/{id}/characters
- response
[ "<name of character>", ..., ... ]