Rest api for phonebook
- Node v10>= or Docker
- NPM
git clone --depth 1 https://github.com/shiva2492/phone-book.git
cd phone-book
npm i
cp .env.example .env
npm dev
npm start
# lint code with ESLint
npm lint
# try to fix ESLint errors
npm lint:fix
# lint and watch for changes
npm lint:watch
# run all tests with Jest and creates coverage report
npm test
# run unit tests
npm test:unit
# run integration tests
npm test:integration
# run all tests and watch for changes
npm test:watch
# show logs in production
pm2 logs
# generate and open api documentation with sample request
npm docs
# run container locally
yarn docker:dev
# run container in production
yarn docker:prod
# run tests
yarn docker:test
Set your server ip:
DEPLOY_SERVER=127.0.0.1
Replace my Docker username with yours:
nano deploy.sh
Run deploy script:
yarn deploy