The Blog API is a simple RESTful API for managing blog posts, built using Node.js and MySQL.
- Clone this repository:
git clone https://github.com/Jai0401/blog-api.git
- Install dependencies:
cd blog-api
npm install
- Set up your environment variables (e.g., database connection details).
- Run migrations to create database tables:
npx sequelize-cli db:migrate
- Start the server:
npm start
- Access the API at
http://localhost:3000
.
npm test
- 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 for more details.