simple stateless microservice in Nodejs, with three major functionalities -
npm install
npm start
using docker image
docker pull theashraf/simple-microservice
docker run -d -p 3000:3000 theashraf/simple-microservice
for the available user accounts for testing , check the user model
Request: Login with credentials to recieve a JSON web token
Headers
Body
{
"username": "admin",
"password": "admin"
}
Response: 200 (application/json)
{
"token": "$authToken"
}
Request: Apply the json patch to the json object, and return the resulting json object.
Headers
Body
{
"originalDoc": {
"baz": "qux",
"foo": "bar"
},
"patch": [
{ "op": "replace", "path": "/baz", "value": "boo" },
{ "op": "add", "path": "/hello", "value": ["world"] },
{ "op": "remove", "path": "/foo" }
]
}
Response: 200 (application/json)
{
"baz": "boo",
"hello": ["world"]
}
Request: Apply the json patch to the json object, and return the resulting json object.
{
"imgUrl": ""
}
Response: 200 (image/jpg)
<buffer>
npm run dev // start server in development mode
npm test -- --watchAll // run tests
This project is licensed under the MIT License, See LICENSE for more information