Please follow following steps before geting start
- Postgresql
- Node v10 or above
- Knex installed globally
Note: Before starting please do the following step:
- In Postgres create a new DATABASE named 'phone_book'
And then run the following commands
npm install
npm run migrate
npm run build
npm start
- Route: /contacts
- Method: GET
- Route: /api/contact/:id
- Method: GET
- Param: (id) - ID of the contact
- Route: /api/create-contact
- Method: POST
- Params: { firstName, @optional lastName, @optional email, contactNumber }
- Route: /api/add-contact
- Method: POST
- Params: { userId, contactNumber }
- Route: /api/add-email
- Method: POST
- Params: { userId, email }
- Route: /api/search
- Method: GET
- Query Params: { email, firstName, lastName, contact }