Create REST API’s using Spring Boot

  1. Create a spring project using https://start.spring.io/ . Add Spring Web dependency. Download the jar and open in IntelliJ IDE.
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
<scope>provided</scope>
</dependency>
@RestController
public class UserController {

@GetMapping("/user")
public User getUser(){
return User.builder()
.id(1)
.name("User_1")
.address("Kishor Street")
.build();
}

}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store