Skip to content

Latest commit

 

History

History
119 lines (79 loc) · 2.17 KB

README.md

File metadata and controls

119 lines (79 loc) · 2.17 KB

Backend Project

Backend Docker Link

Backend Github Link


Postman Published link

A simple stateless microservice in Node.js, with three major functionalities:

  • Authentication
  • JSON patching
  • Image Thumbnail Generation

Authentication

A login request body that contains an arbituary username/password pair that returns a signed Json Web Token to access specific end points.

Sign Up User


Request

{ "username": string,
"password": string }

Response

{ "message": "Successfully signed up" }

Link

Sign up user

Sign in/Login User


Request

{ "username": string,
"password": string }

Response

{ "message": "User signed in successfully",
"token": string }

Link

Login User

Applying JSON Patch


Request body contains a JSON object and a JSON patch object, which returns a formatted or patched JSON object.

Request

{
"jsonObj": {
"firstName": "Segun",
"lastName": "David",
"gender": "male",
"age": 25,
"status": "happy"
},
"jsonPatchObj": [
{"op": "add", "path": "/status", "value": {"location": "Lagos"}},
{"op": "remove", "path": "/status"},
{"op": "replace", "path": "/age", "value": 90},
{"op": "copy", "from": "/firstName", "path": "/lastName"},
{"op": "move", "from": "/firstName", "path": "/gender"}
] }

Response

{
"message": "Data Edited",
"patchedDoc": {
"lastName": "Segun",
"gender": "Segun",
"age": 90
} }

JSON Patching Object

Create Thumbnail Request

Request body contains a public image url. The image is downloaded, resized and saved to 'thumbnails'

Request

{ "uri": "https://cdn.pixabay.com/photo/2020/06/01/10/02/puffin-5246026_960_720.jpg" }

Image

Thumbnail


Thumbnail image