Saturday, July 1, 2023

Create your first REST API in just 5 steps.

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. 
  1. Step 1 : Open your favourite browser and navigate to https://start.spring.io/ 
  2. 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.

  3. Your project will be in .zip file, extract it and open with your IDE eg. Intellij IDEA
  4. Create a new class with name "TestController" inside - demo -> src -> main -> java -> com.example.demo 
    TestController
  5. 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 :) 






If you have any query or suggestion please mention them in the comment box. Also feel free to Connect with us on: Facebook: https://www.facebook.com/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

Google Account rename kaise karen II How to rename Google Account II Google Account II Google

In this video you can see how to rename your Google Account and its nick name. If you have any query or suggestion please mention them in th...