package com.sparta.week01.controller;
import com.sparta.week01.person.Person;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class PersonController {
@GetMapping("/people")
public Person getPeople() {
Person person = new Person("name",100,"Seoul");
return person;
}
}
@Controller는 클라이언트의 요청을 전달받는 코드이다.
@RestController는 json만 돌려준다.