https://github.com/lahcenezzara/spring-boot-explorer
A simple Spring Boot project showcasing a "Hello World" endpoint with a friendly response. The project demonstrates the foundational structure of a Spring Boot web application, which can be expanded further.
https://github.com/lahcenezzara/spring-boot-explorer
api-development backend-development beginner-friendly hello-world java java-17 maven microservices openjdk rest-api rest-controller spring-boot spring-boot-example spring-boot-guide spring-boot-project spring-boot-starter spring-framework spring-tutorial spring-web web-application
Last synced: 11 months ago
JSON representation
A simple Spring Boot project showcasing a "Hello World" endpoint with a friendly response. The project demonstrates the foundational structure of a Spring Boot web application, which can be expanded further.
- Host: GitHub
- URL: https://github.com/lahcenezzara/spring-boot-explorer
- Owner: LahcenEzzara
- Created: 2024-11-26T22:56:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-13T04:50:13.000Z (about 1 year ago)
- Last Synced: 2024-12-13T05:24:43.136Z (about 1 year ago)
- Topics: api-development, backend-development, beginner-friendly, hello-world, java, java-17, maven, microservices, openjdk, rest-api, rest-controller, spring-boot, spring-boot-example, spring-boot-guide, spring-boot-project, spring-boot-starter, spring-framework, spring-tutorial, spring-web, web-application
- Language: Java
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spring Boot Explorer
A simple Spring Boot application that demonstrates a "Hello World" endpoint with a customizable message. This project is designed to be beginner-friendly and serves as a foundation for exploring Spring Boot features.
---
## ๐ **Features**
- A RESTful `/hello` endpoint.
- Returns a friendly greeting message.
- Option to customize the greeting using a query parameter.
---
## ๐ ๏ธ **Technologies Used**
- **Java 17** (OpenJDK)
- **Spring Boot** (Latest version)
- **Maven** (Build tool)
- **IntelliJ IDEA** (Development environment)
---
## ๐ **Project Structure**
```plaintext
src/main/java/com/lahcencodes/springbootexplorer/
โโโ SpringBootExplorerApplication.java # Main application file
```
---
## ๐ **Endpoints**
### **Hello Endpoint**
- **URL:** `http://localhost:8080/hello`
- **Method:** `GET`
- **Description:** Returns a greeting message.
- **Query Parameter:**
- `name` (optional): Customize the name in the greeting message.
#### Example Requests:
1. Default greeting:
```bash
curl http://localhost:8080/hello
```
**Response:**
```json
Hello World!
```
2. Custom greeting:
```bash
curl http://localhost:8080/hello?name=Lahcen
```
**Response:**
```json
Hello Lahcen!
```
---
## โก **Getting Started**
### Prerequisites
Ensure you have the following installed:
1. **Java 17** (OpenJDK 17)
2. **Maven** (for building the project)
3. **Git** (for cloning the repository)
---
### **Steps to Run**
1. **Clone the Repository**
```bash
git clone https://github.com/LahcenEzzara/spring-boot-explorer.git
cd spring-boot-explorer
```
2. **Build the Application**
```bash
./mvnw clean install
```
3. **Run the Application**
```bash
./mvnw spring-boot:run
```
4. Open your browser or API testing tool and navigate to:
- [http://localhost:8080/hello](http://localhost:8080/hello)
---
## ๐งช **Testing the Application**
### Using `curl`
1. Default greeting:
```bash
curl http://localhost:8080/hello
```
2. Custom greeting:
```bash
curl http://localhost:8080/hello?name=LahcenCodes
```
### Using Postman
1. Create a new GET request.
2. Enter the URL: `http://localhost:8080/hello`.
3. Add a query parameter (optional): `name=LahcenCodes`.
4. Send the request.
---
## ๐ง **Stopping the Server**
1. **If running in the foreground**:
Press **`Ctrl + C`** to terminate the application.
2. **If running in the background**:
Find the process:
```bash
ps aux | grep java
```
Kill the process:
```bash
kill
```
---
## ๐ **License**
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
---
## ๐ก๏ธ **Support**
If you have any questions or need help, feel free to contact me via [GitHub](https://github.com/LahcenEzzara).
Happy coding! ๐