https://address-book-api-assignment.herokuapp.com/
Field | Type | Required | Unique | Default |
---|---|---|---|---|
name | String | True | False | - |
address | String | True | False | - |
contact | String | True | True | - |
Method | Route | Parameters | Query parameters | Body | Description |
---|---|---|---|---|---|
GET | /api/auth/get-jwt | - | - | - | Get JWT access token |
GET | /api/contact/id | {id} | - | - | Get single contact by using its ID |
GET | /api/contact/query | - | {name, address, contact} | - | Get contacts by using query parameters |
GET | /api/contact | - | {page, limit} | - | Get paginated list of contacts |
POST | /api/contact/new/single-contact | - | - | {name: String, address: String, contact: String} | Create new single contact |
POST | /api/contact/new/bulk-contact | - | - | [{name: String, address: String, contact: String}] | Create bulk contacts |
PATCH | /api/contact | - | {id} | - | Update existing contact details |
DELETE | /api/contact | - | {id} | - | Delete existing contact |
-
Clone the repo to your local machine.
-
Install the required dependency for server using :
npm install
-
Create a .env file inside the root folder and provide the following environment variables:
PORT=<port> MONGODB_URI=<mongo_uri> JWT_SECRET=<your_jwt_secret> JWT_EXPIRE=5d
-
Start the dev server using :
npm run dev
Varun Kumar Tiwari LinkedIn Github |