- JWT Token Authentication
- JSON Patching API
- Generate Image Thumbnail
Endpoints and sample requests are included below for your convenience.
The JSON Patching and Image Thumbnail APIs are protected with JWT. Find authentication instructions locally with docs Swagger here
- Clone the repository with
git clone <insert_repo>
- Create
.env
file at project root update with.env.example
as template - Run
npm install
from project root - Start the server with
npm start
The Docker is image available publicly here
- Run
docker pull deschant/deschant/hb-nodejs-microservice
- Start container with:
docker run --name hb-nodejs-microservice -p 3000:3000 -d deschant/hb-nodejs-microservice
POST /api/auth/login
Example request body:
{
"username": "jake",
"password": "jakejake"
}
PATCH /api/json/patch
Example request body:
{
json: {
"baz": "qux",
"foo": "bar"
},
patch: [
{ "op": "replace", "path": "/baz", "value": "boo" },
{ "op": "add", "path": "/hello", "value": ["world"] },
{ "op": "remove", "path": "/foo" }
]
}
POST /api/thumbnail/generate
Example request body:
{
"imgUrl": "https://images.pexels.com/photos/318391/pexels-photo-318391.jpeg"
}