import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/api") public class MyController { @GetMapping("/hello") public String sayHello() { return "Hello, World!"; } public static void main(String[] args) { SpringApplication.run(MyController.class, args); } }


上一篇:
下一篇:
切换中文