anu-007 / thumbnail_microservice

A simple thumbnail generator microservice

Home Page:https://evening-brook-66750.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Thumbnail generator microservice

travis build

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.

Installation

Prerequisites

Installation

  • git clone <repository-url> this repo
  • cd nodejs_microservice
  • npm install

Running

Running tests

  • npm test

Running coverage

  • npm run coverage

API endpoints

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 /

  1. Request
    • Headers content-Type: application/json
  2. Response
    • Headers content-Type: application/json; charset=utf-8
    • Body
    {
        "message": "welcome to the microservice: go to /login route and enter username and password"
    }
    

POST /login

  1. Request
    • Headers content-Type: application/json
    • Body
    {
        "user"	:	<any-usernaem>,
        "password"	:	<any-password>
    }
    
  2. Response
    • Headers content-Type: application/json; charset=utf-8
    • Body
    {
        "token": <jwt-token>
    }
    

POST /ptch

  1. Request
    • Headers content-Type: application/json Authorization: bearer <access-token>
    • Body
    {
        <any-key>: <any-value>
    }
    
  2. Response
    • Headers content-Type: application/json; charset=utf-8
    • Body
    {
        <patched-keys>: <patched-values>
    }
    

POST /thumb

  1. Request
    • Headers content-Type: application/json Authorization: bearer <access-token>
    • Body
    {
        "url": <any-image-url>
    }
    
  2. Response
    • Headers content-Type: image/<type-of-image>
    • Body <image>

About

A simple thumbnail generator microservice

https://evening-brook-66750.herokuapp.com/


Languages

Language:HTML 50.0%Language:JavaScript 34.6%Language:CSS 15.4%