Rest api for phonebook
- Node v10>= or Docker
- Yarn
git clone --depth 1 https://github.com/osamabari/rest_api
cd rest_api
yarn
cp .env.example .env
yarn dev
and open http://localhost:3000/v1/status to check api is running or not
Step 1:
yarn docs
Step2:
yarn dev
Step3:
open http://localhost:3000/v1/docs in web browser
Import Phonebook_API.postman_collection.json file in postman to start
yarn start
# lint code with ESLint
yarn lint
# try to fix ESLint errors
yarn lint:fix
# run all tests with Mocha
yarn test
# show logs in production
pm2 logs
# generate and open api documentation
yarn 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