Skip to content

SpringBoot-Begin-to-Advance/SpringBoot_Basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Java Spring Boot REST API Example

This is a simple Spring Boot application that exposes REST endpoints to return predefined messages.

Project Structure

  • 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.

Technologies Used

  • 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.

How to Run the Application

  1. Clone the repository:
    git clone <https://github.com/sharada0417/SpringBoot_Basic.git>
  2. Navigate to the project directory:
    cd basic
  3. Build and run the application using Maven:
    mvn spring-boot:run
  4. The application will start on http://localhost:8080

API Endpoints

1. /app/msg

  • Method: GET
  • Description: Returns a welcome message.
  • Response:
    "Hello SpringBoot"

2. /app/name

  • Method: GET
  • Description: Returns a predefined name message.
  • Response:
    "Hello My name is SpringBoot"

3. /app/age

  • Method: GET
  • Description: Returns a predefined age message.
  • Response:
    "Hello My age is 23"

4. /app/regno

  • Method: GET
  • Description: Returns a predefined registration number message.
  • Response:
    "Hello My reg no is 51"

License

This project is open-source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages