Skip to content

Repository files navigation

Contacts API

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.

Project Overview

  • Week 01 Goals:
    • Set up the project and database.
    • Import data into the database.
    • Complete the GET API routes (GET all contacts and GET a single contact by ID).
    • Deploy the app to Render.

Technologies Used

  • Backend: Node.js, Express.js
  • Database: MongoDB Atlas
  • Deployment: Render
  • Testing: REST Client (e.g., Postman or REST Client extension for VSCode)

Getting Started

Prerequisites

  • Node.js and npm installed on your local machine.
  • A MongoDB Atlas account.
  • A Render account for deployment.
  • Git installed for version control.

Installation

  1. Clone the Repository

    git clone git@github.com:DevaWinner/cse341-node.git
    cd cse341-node
  2. Install Dependencies

    npm install

API Reference

Base URL

  • URL: https://contacts-api-123.onrender.com

Get All Contacts

  • Endpoint: /contacts
  • Method: GET
  • Description: Retrieves all contacts from the database.
  • Response: Array of contact objects.

Get Contact by ID

  • 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.

Testing

  • Use the requests.rest file with the REST Client extension in VSCode.
  • Alternatively, use a tool like Postman or cURL to test the endpoints.

Video Demonstration

A video demonstrating the functionality of this project is available on YouTube:

License

This project is for my educational purposes.

Contact

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages