The app should meet the following requirements:
- Application should stores data in a db but not necessary to be a real db. Db such as lowdb (https://github.com/typicode/lowdb) is ok.
- Api should be authenticated by Basic Auth;
- All user's password should be reverse of username and length > 0, e.g. username: zendesk123 password: 321ksednez
- Api should be able to add a todo
- Api should be able to complete a todo
- Api should be able to query todo list supporting
all
,active
,complete
filtering - Api should be able to remove a todo
- Todo list is not shared between users
- Documentation of the api, such as path, param, examples
- Bonus: include a dockerfile
We use semantic-release
to generate release notes. This make use of conventional commit structure for both the notes and release numbers.
- Create Github and NPM tokens
- Export these tokens into your
~/.bash_profile
and source it:
export GH_TOKEN={your github token}
export NPM_TOKEN={your npm token} # should be optional
- Available tasks
npm install
npm run start:local # to start app
npm run start:local:watch # to start app and watch for any changes
npm run test # to test app
npm run cover # to get code coverage
- Run
docker-compose up -d
There is swagger integrated to help you easier navigate through all exposed restful api. Please follow:
docker-compose up -d
open http://localhost:9001/api/
Notice: The secure token is zendesk
npm run release