Welcome to the Contact Service API! This API allows you to perform CRUD operations on a contact database.
-
Clone the repository:
git clone https://github.com/VedantSharma11/Interactly-task
-
Install dependencies:
cd contact-service-api npm install
-
Create a
.env
file:Create a file named
.env
in the root directory and add your MongoDB Atlas connection string:MONGODB_ATLAS_URI=YOUR_MONGODB_ATLAS_CONNECTION_STRING
-
Run the application:
npm start
The server will start on
http://localhost:3000
.
To run the project, follow these steps:
-
Start the server:
npm start
The server will start on
http://localhost:3000
. -
Access the API guide:
Visit
http://localhost:3000
in your web browser or use a tool likecurl
:curl http://localhost:3000
This will provide you with a guide on how to use the API endpoints.
- GET /contacts: Get all contacts.
- POST /contacts: Create a new contact.
- PUT /contacts/:id: Update an existing contact.
- DELETE /contacts/:id: Delete a contact.
- GET /contacts/:id: Get a specific contact by ID.