This project is an API for storing and retrieving information about contacts, such as my friends data. The API interacts with a MongoDB database and allows for future frontend integration.
- Week 01 Goals:
- Set up the project and database.
- Import data into the database.
- Complete the GET API routes (
GETall contacts andGETa single contact by ID). - Deploy the app to Render.
- Backend: Node.js, Express.js
- Database: MongoDB Atlas
- Deployment: Render
- Testing: REST Client (e.g., Postman or REST Client extension for VSCode)
- Node.js and npm installed on your local machine.
- A MongoDB Atlas account.
- A Render account for deployment.
- Git installed for version control.
-
Clone the Repository
git clone git@github.com:DevaWinner/cse341-node.git cd cse341-node -
Install Dependencies
npm install
- URL:
https://contacts-api-123.onrender.com
- Endpoint:
/contacts - Method:
GET - Description: Retrieves all contacts from the database.
- Response: Array of contact objects.
- Endpoint:
/contacts/{id} - Method:
GET - URL Parameter:
id(string) - The unique identifier of the contact. - Description: Retrieves a single contact by its ID.
- Response: Contact object.
- Use the
requests.restfile with the REST Client extension in VSCode. - Alternatively, use a tool like Postman or cURL to test the endpoints.
A video demonstrating the functionality of this project is available on YouTube:
This project is for my educational purposes.
- Author: Aniekan Winner Anietie
- Email: aanietie@byupathway.edu