https://github.com/jai0401/blog-api
A simple RESTful API for managing blog posts, built using Node.js and MySQL.
https://github.com/jai0401/blog-api
backend blog blog-api-with-nodejs-and-expressjs blog-app blog-app-crud express-js javascript mysql nodejs rest-api sequelize
Last synced: 7 months ago
JSON representation
A simple RESTful API for managing blog posts, built using Node.js and MySQL.
- Host: GitHub
- URL: https://github.com/jai0401/blog-api
- Owner: Jai0401
- Created: 2024-04-10T22:05:00.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-28T11:08:42.000Z (over 1 year ago)
- Last Synced: 2025-01-24T21:43:22.651Z (8 months ago)
- Topics: backend, blog, blog-api-with-nodejs-and-expressjs, blog-app, blog-app-crud, express-js, javascript, mysql, nodejs, rest-api, sequelize
- Language: JavaScript
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blog API
The **Blog API** is a simple RESTful API for managing blog posts, built using Node.js and MySQL.
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Testing](#testing)
- [Endpoints](#endpoints)## Installation
1. Clone this repository:
```
git clone https://github.com/Jai0401/blog-api.git
```
2. Install dependencies:
```
cd blog-api
npm install
```
3. Set up your environment variables (e.g., database connection details).
4. Run migrations to create database tables:
```
npx sequelize-cli db:migrate
```## Usage
1. Start the server:
```
npm start
```2. Access the API at `http://localhost:3000`.
## Testing
```
npm test
```## Endpoints
- **GET /posts**: Get a list of all blog posts.
- **GET /posts/:id**: Get a specific blog post by ID.
- **POST /posts**: Create a new blog post.
- **PUT /posts/:id**: Update an existing blog post.
- **DELETE /posts/:id**: Delete a blog post.Checkout [API Documentation](https://github.com/Jai0401/blog-api/blob/master/API%20Documentation.md) for more details.