Today we are going to see how to create your first REST API in just 5 steps.
Before starting this article let's take go through the prerequisites.
Prerequisites :
- Familiarity with Java Programming language.
- Any IDE, for this example I'll be using IntelliJ IDEA CE.
- Web Browser and Internet connection.
- We are good to start.
Let's go and Create our first endpoint. Just follow along and you will be able to create your endpoint within few minutes.
- Step 1 : Open your favourite browser and navigate to https://start.spring.io/
- Configure your project :
- Select Maven Project
- Choose Java Language
- Select stable version of Spring Boot e.g. 3.1.1
- For now we can leave the Project Metadata as it is.
- Add Spring Web dependency.
- Click Generate and it will download the project.
- Your project will be in .zip file, extract it and open with your IDE eg. Intellij IDEA
- Create a new class with name "TestController" inside - demo -> src -> main -> java -> com.example.demo
- And we are done, just go to DemoApplication and run the main method. It will start Tomcat Server at the port 8080. Open your browser and enter http://localhost:8080/ and you will see the output : Hello from Spring Boot Application

Hope you were able to create your first endpoint :)
Instagram: https://www.instagram.com/surajkaschool/
Twitter: https://twitter.com/SurajKaSchool
LinkedIn : https://linkedin.com/company/suraj-ka-school
YouTube: https://bit.ly/SurajKaSchool
Let's have a discussion on Facebook group:
To connect with us please click here:
https://bit.ly/TechnosEducationGroup
If you like this post kindly comment below and do share your response. Thanks for watching.
No comments:
Post a Comment