You need to add a class, then write a method, annotate using RestController
@RestController
public class HelloWorld {
@RequestMapping("/")
public String sayHelloWorld(){
return "hello world!";
}
}
Then start it through the class run in springApplicationMain
Then the browser accesses: http://127.0.0.1:8081/ and you can see hello world
Explain that the role of the RestController annotation is to return data in json format