This is a Spring Boot application that provides REST API endpoints for managing blog posts.
To run this application, you will need the following:
- Java 8 or higher
- Maven 3.6 or higher
- Clone the repository to your local machine:
+git clone https://github.com/<username>/spring-boot-blog-rest-api.git
- Navigate to the project directory:
+cd spring-boot-blog-rest-api
- Build the project using Maven:
+mvn clean install
- Run the application:
+mvn spring-boot:run
- The application will start running on http://localhost:8080.
The following endpoints are available:
GET /posts
: Get a list of all blog posts.POST /posts
: Create a new blog post.GET /posts/{id}
: Get a specific blog post by ID.PUT /posts/{id}
: Update a specific blog post by ID.DELETE /posts/{id}
: Delete a specific blog post by ID.
Response Body:
[
{
"id": 1,
"title": "My First Blog Post",
"content": "This is the content of my first blog post.",
"createdAt": "2023-05-10T10:05:23.000Z",
"updatedAt": "2023-05-10T10:05:23.000Z"
},
{
"id": 2,
"title": "My Second Blog Post",
"content": "This is the content of my second blog post.",
"createdAt": "2023-05-11T08:20:15.000Z",
"updatedAt": "2023-05-11T08:20:15.000Z"
}
]
- A discussion around the change.
- A GitHub Issue with a good description associated with the PR
- One feature/change per PR
- One commit per PR
- PR rebased on main (
git pull
) - Good descriptive commit message, with link to issue
- No changes to code not directly related to your PR
- Includes functional/integration test
- Includes documentation
This repository was created by @tsaransh. If you have any questions or feedback, feel free to reach out to me.