https://github.com/ioedeveloper/micro-service
Micro-Service
https://github.com/ioedeveloper/micro-service
Last synced: about 1 year ago
JSON representation
Micro-Service
- Host: GitHub
- URL: https://github.com/ioedeveloper/micro-service
- Owner: ioedeveloper
- Created: 2018-08-17T13:03:55.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-17T22:55:15.000Z (almost 8 years ago)
- Last Synced: 2025-02-08T16:32:35.813Z (over 1 year ago)
- Language: JavaScript
- Size: 40 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MICRO-SERVICE
A stateless micro-service in Node, which implements Authentication, JSON patching and Image Thumbnail Generation.
## Docker Image
[index.docker.io/ioedeveloper/micro-service:latest](https://index.docker.io/ioedeveloper/micro-service:latest)
## How To Setup Application
1. install node.js
2. clone repository
3. run `npm install` to download and install all application dependencies.
4. run `npm start` to start application on port 8001
## How To Use MICRO-SERVICE
1. Make a POST request to http://localhost:8001/login with request body containing `username` and `password` to generate **JSON Web Token** for subsequent requests to protected routes.
2. Make a PATCH request to http://localhost:8001/applyjsonpatch with request body containing `jsonobject` and a `jsonpatchobject` to apply patch to jsonobject and return result.
3. Make a POST request to http://localhost:8001/createthumbnail with request body containing `url` pointing to a public image. This request if successfull will resize the image and return a 50X50 thumbnail image.