https://github.com/aakashdeveloper/attainu
https://github.com/aakashdeveloper/attainu
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/aakashdeveloper/attainu
- Owner: Aakashdeveloper
- Created: 2020-10-29T19:32:33.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-29T20:33:50.000Z (over 4 years ago)
- Last Synced: 2025-01-13T00:53:10.922Z (6 months ago)
- Language: JavaScript
- Size: 250 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Your task is to build a simple stateless microservice in Node Js, with three major functionalities -
> Authentication
> JSON patching
> Image Thumbnail Generation> Technology use ==> NodeJs \
> Npm Packages ==> body-parser, cors, express, jsonpatch, jsonwebtoken, request, sharp, @babel/core ,@babel/preset-env,
"@babel/register# Application have 3 end point
> To Authenticate the user \
**(POST)** > https://attainu-code.herokuapp.com/api/auth/login \
**(Body)** > {"email":"[email protected]","password":"12345678"} \
**(Repsponse)** >
{
"auth": true,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9eyJpZCI6ImFiY0BnbWFpbC5jb20iLCJpYXQiOjE2MDM5OTg1MzQsImV4cCI6MTYwNDA4NDkzNH0.WqfRqhcWVjkxPRH6nTmAsQ9WKJ__r1BDTqWJRF4rtCw"
}
Token is valid for one hour after each login
> JSON patching \
**(GET)** > https://attainu-code.herokuapp.com/api/auth/jsonpatch \
**(Header)** > ['x-access-token':'token generated in first call'] \
**(Response)** > {
"baz": "boo",
"foo": "bar"
}
> Image Thumbnail Generation \
**(GET)** >https://attainu-code.herokuapp.com/api/auth/imageConvert \
**(Pass Query params)** ?url=https://cdn.idsitnetwork.net/wp-content/uploads/sites/27/2019/01/flower-shop-fields-of-romance-148245.jpg \
**(Header)** > ['x-access-token':'token generated in first call'] \
**(response)** > Paste Url in browser to download image "https://attainu-code.herokuapp.com/api/auth/imageOutput"
> Check Image output \
**(GET)** > https://attainu-code.herokuapp.com/api/auth/imageOutput \
**(Response)** > Converted Image \
