A Koa API back end for one interview assignment.
git clone https://github.com/ChadoNihi/koa-api-interview-task && cd koa-api-interview-task
- Install dependencies with
yarn install
(ornpm install
). (A list of the dependencies is inpackage.json
.) - Run the app in development mode with
yarn start-dev
(ornpm run start
), for production --yarn start
(ornpm run start
).
API (more detailed specs are in open-api.yaml)
{
"username": "Green Red",
"password": "123"
}
{
"token": "someJWT",
"msg": "Successful Authentication"
}
{
"target": {
"baz": "qux",
"foo": "bar"
},
"patch": [
{ "op": "replace", "path": "/baz", "value": "boo" },
{ "op": "add", "path": "/hello", "value": ["world"] },
{ "op": "remove", "path": "/foo"}
]
}
{
"result": {
"baz": "boo",
"hello": ["world"]
}
}
Returns a "thumbnail" of an image from the provided URL.
Run tests with yarn test
(or npm test
). yarn cover
(or npm run cover
) runs the tests too, plus generates a test coverage report.
Lint the code with yarn lint --fix
(or npm run lint --fix
).
Run the app with PM2 with yarn pm2
(or npm run pm2
). (To kill the process enter yarn pm2-kill
(or npm run pm2-kill
).)