This is a simple Spring Boot application that exposes REST endpoints to return predefined messages.
- AppController.java: Contains the REST API endpoints.
@RestController: Indicates that this class handles REST requests.@RequestMapping("/app"): Maps all endpoints under/app.@GetMapping("/msg"): Returns a welcome message.@GetMapping("/name"): Returns a predefined name message.@GetMapping("/age"): Returns a predefined age message.@GetMapping("/regno"): Returns a predefined registration number message.
- Java: The primary programming language for the application.
- Spring Boot: A framework for building Java-based RESTful web services.
- Maven: Dependency management and build automation tool.
- Clone the repository:
git clone <https://github.com/sharada0417/SpringBoot_Basic.git>
- Navigate to the project directory:
cd basic - Build and run the application using Maven:
mvn spring-boot:run
- The application will start on
http://localhost:8080
- Method:
GET - Description: Returns a welcome message.
- Response:
"Hello SpringBoot"
- Method:
GET - Description: Returns a predefined name message.
- Response:
"Hello My name is SpringBoot"
- Method:
GET - Description: Returns a predefined age message.
- Response:
"Hello My age is 23"
- Method:
GET - Description: Returns a predefined registration number message.
- Response:
"Hello My reg no is 51"
This project is open-source and available under the MIT License.