docker image - image
demo app url - app
A simple thumbnail generator microservice which generates thumbnails of size 50x50. It uses jwt authorization for its protected routes.
git clone <repository-url>this repocd nodejs_microservicenpm install
npm start- test with postman for the following end-points
- Visit app at http://localhost:4000.
npm test
npm run coverage
use any API testing tools like postman to test this API. App is hosted at https://evening-brook-66750.herokuapp.com if you are not testing on localhost mahe sure to append this url before the API requests.
GET /
- Request
- Headers
content-Type: application/json
- Headers
- Response
- Headers
content-Type: application/json; charset=utf-8 - Body
{ "message": "welcome to the microservice: go to /login route and enter username and password" } - Headers
POST /login
- Request
- Headers
content-Type: application/json - Body
{ "user" : <any-usernaem>, "password" : <any-password> } - Headers
- Response
- Headers
content-Type: application/json; charset=utf-8 - Body
{ "token": <jwt-token> } - Headers
POST /ptch
- Request
- Headers
content-Type: application/jsonAuthorization: bearer <access-token> - Body
{ <any-key>: <any-value> } - Headers
- Response
- Headers
content-Type: application/json; charset=utf-8 - Body
{ <patched-keys>: <patched-values> } - Headers
POST /thumb
- Request
- Headers
content-Type: application/jsonAuthorization: bearer <access-token> - Body
{ "url": <any-image-url> } - Headers
- Response
- Headers
content-Type: image/<type-of-image> - Body
<image>
- Headers