Skip to content

A RESTful API built with Node.js and Express for managing contacts. It supports CRUD operations and utilizes MySQL for data storage.

License

Notifications You must be signed in to change notification settings

plan28-06/Contacts_REST_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contacts_REST_API

A RESTful API built with Node.js and Express for managing contacts. It supports CRUD operations and utilizes MySQL for data storage.

I ran MySQL in a Docker container, made use of Docker volumes to ensure data persists even after the container is stopped or removed.

Used POSTMAN to test the API.

This API only runs locally for now 😭😭😭, I plan to host the database and the API in the future if I decide to proceed with deployment.

Steps to run the API given below.

Note: Please excuse the large amount of comments in my code, they are for review (when I comeback to this later).

API Endpoints

endpoints

Working Screenshots

GET (All Contacts)

get contacts

GET (Contact By ID)

get contact by id

POST ( Create Contact)

create contact

PUT ( Update Contact)

update contact

DELETE (Delete Contact by id)

delete contact

How To Use The API

To run the API locally, follow these steps:

  1. Clone the Repository

    git clone https://github.com/your-username/contacts-api.git
    cd contacts-api
    
  2. Install Dependencies

     npm install
    
  3. Create Database contacts(In MYSQL)

    CREATE DATABASE contacts
    
  4. Create Table Contacts (IN MYSQL)

    USE contacts;
     CREATE TABLE Contacts (
     id INT PRIMARY KEY,
     name VARCHAR(255) NOT NULL,
     number VARCHAR(15) NOT NULL
     );
    
  5. Change MYSQL_PASSWORD To Your Password In The Dotenv File

  6. Start The Application

     npm start
  7. Test The API Via POSTMAN / OPENAPI

About

A RESTful API built with Node.js and Express for managing contacts. It supports CRUD operations and utilizes MySQL for data storage.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published