restapi controller
를 사용해서 어떤 주소에 맵핑을 해준다.
@RestController
@RequestMapping("/api")
public class RestApiController {
@GetMapping(path = "/hello")
public String hello(){
var html = "<html> <body> <h1>Hello spring</h1> </body></html>";
return html;
}
}
이런식으로 한다.
RestController 이러한 restcontroller의 특정한 기능하는 특정한 클래스를 지정해주기위한 것
RequestMapping("/api")는 주소를 받아들이겠다. 이컨트롤러는
GetMapping 은 api하위에 주소를 하나 만들었다. 문자열을 리턴하는것이다

