Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 1.33 KB

README.md

File metadata and controls

53 lines (37 loc) · 1.33 KB

Blog Management RESTful API

This is a RESTful API for managing blogs, built using Java.

Features

  • Create, Read, Update, and Delete blog posts.
  • Search blogs by ID.
  • Shows blogs with Pagination.

Getting Started

Prerequisites

  • Java 21 (Recomended) or later
  • Maven 3.9.9 or later
  • A database (e.g., MySQL, PostgreSQL)

Installation

  1. Clone the repository:

    git clone https://github.com/5OBHAN/Blog-Management-Restful-API.git && cd Blog-Management-Restful-API
  2. Configure the database connection in application.properties:

    Path: src/main/resources/application.properties

    spring.datasource.url=jdbc:mysql://<HOST>:<PORT>/{YOUR_DB_NAME}
    spring.datasource.username={YOUR_DB_USERNAME}
    spring.datasource.password={YOUR_DB_PASSWORD}
  3. Build and run the application:

    mvn clean install
    mvn spring-boot:run

API Endpoints

Blog Posts

  • POST /api/v1/blogs - Create a new blog post
  • GET /api/v1/blogs/{id} - Get a single blog post by ID
  • GET /api/v1/blogs - Get all blog posts
  • PUT /api/v1/blogs/{id} - Update a blog post by ID
  • DELETE /api/v1/blogs/{id} - Delete a blog post by ID

License

This project is licensed under the MIT License. See the LICENSE file for details.