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).
To run the API locally, follow these steps:
-
Clone the Repository
git clone https://github.com/your-username/contacts-api.git cd contacts-api
-
Install Dependencies
npm install
-
Create Database contacts(In MYSQL)
CREATE DATABASE contacts
-
Create Table Contacts (IN MYSQL)
USE contacts; CREATE TABLE Contacts ( id INT PRIMARY KEY, name VARCHAR(255) NOT NULL, number VARCHAR(15) NOT NULL );
-
Change MYSQL_PASSWORD To Your Password In The Dotenv File
-
Start The Application
npm start
-
Test The API Via POSTMAN / OPENAPI