This project is a simple backend CRUD API built using Express, Node.js, and MySQL. It provides basic functionality to create, read, update, and delete blog posts.
- Create a new blog post
- Retrieve a blog post by ID
- Retrieve all blog posts
- Update an existing blog post
- Delete a blog post
Before running the project, make sure you have the following installed:
- Node.js (https://nodejs.org)
- MySQL (https://www.mysql.com)
-
Clone the repository:
git clone <repository-url>
-
Install Dependecies if needed
npm install express mysql2 dotenv
-
Run Project
npm start
Use any API enpoints of your choice POSTMAN or ISONMIA anything goes
- Endopoints => /posts
- content to
POSTis json {title , content}
{
"title": "Title or Heading here",
"content": "Content here"
}- Endopoints => /posts/:id
- Output is an array of data of specific :id
[{title , content}](result[0])
- Endpoint => /posts
- Output is an array of all Blog Post
- Endpoint => /posts/:id
- Update Blog Post of a specific :id
- content to
PUTis json {title , content}
{
"title": "Update",
"content": "Content here"
}- Endpoint => /posts/:id
- Delete Blog Post of a specific :id
CREATE DATABASE blog_database;
USE blog_database;
CREATE TABLE posts (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255),
content TEXT
);Kindly create this schema or database in your mySQL and link to the project
This project will be updated as times go on for better implication Authentication process is being worked on .. - Just got started with JS