You have to create a simple REST API to allow our team to perform CRUD operations on Clovis' users. These expected operations are specified in the tests.
- Because Clovis backend use KoaJS as web framework you must also use it in this exercise.
- You must be able to insert, fetch, update and delete users accounts
- All tests must pass and can't be modified (even the lint !)
- The build and code errors generated by this boilerplate are part of the test.
If you have a problem, start by reading the API and database tests and KoaJS doc. If it doesn't help you, ask for help !
index.js
andapp.js
files are already coded, you just have to code controllers insrc/controllers.js
- You should read koa-router documentation
- You may use lodash which is included in the packages.
In this exercise you will use a really simple database engine. Allowed methods are :
- find
- findById
- create
- updateById
- removeById
If you want to query nested keys use find like in this example :
db.find({
'address.postalCode': 75000,
})
db.find({
'hobbies[0].name': 'NodeJS',
})
...
You have 1 hour !