Application has been bootstrapped using Express Generator
Image resize and conversion is done using Sharp Library
Worker job queue has been created using Kue.JS
Error responses created using Express Boom
Promise Library Bluebird
Process manager for node application PM2
Sharp library mentioned above has been used for image manipulation. Currently works for jpeg/jpg to png conversion and resize only. I have not looked further to rectify this issue.
Tested on Ubuntu 18.04
Tests have been written using Mocha
HTTP assertions using Supertest
Test stubs using Sinon JS
docker-compose up
This step:
- Builds the images
- Installs npm packages
- Runs the tests
- Launches the two services: app (Express server) and imageWorker (Processes jobs in queue)
npm install && npm run test
Runs the tests for application
npm install && npm run lint
Lints the code. eslint-config-google configuration has been extended.
GET /image/:id/thumbnail
Request PNG thumbnail version of an image
POST /image/
Sumbit an image for processing to PNG thumbnail
Full API Docs for routes can be found at routes/images.js