Node image processing API using :
- Koa 2
- Mongodb + Mongoose
- Sharp
docker-compose up
Depending on what version of Docker you are using the app will be available on either http://localhost:3000 or http://192.168.99.100:3000/
Install dependencies
npm install
Start a Local Server
npm start
Run Tests
npm test
Building and Running Production Server
npm run prod
Note : Please make sure MongoDB is running before using npm start
or npm run prod
There's a Postman collection included which has info on all the endpoints.
curl -X GET http://localhost:3000/v1/images
curl -X GET http://localhost:3000/v1/images/:id
curl -X POST \
http://localhost:3000/v1/authenticate \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-d password=bynd
curl -X POST \
http://localhost:3000/v1/upload \
-H 'authorization: Bearer <token>' \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data' \
-F image=@__tests__/files/image.png
curl -X DELETE \
http://localhost:3000/v1/images/:id \
-H 'authorization: Bearer <token>' \
-H 'cache-control: no-cache' \
curl -X GET http://localhost:3000/v1/resize/:id?width=x&height=x
curl -X GET http://localhost:3000/v1/rotate?angle=x
angle should be a multiple of 90