springboot 极简案例
安装idea
File -> New Project
选择依赖
创建controller文件
输入controller类名
输入代码
运行项目
访问
localhost:8080/hello/boot
package com.example.demo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/hello")
public class HelloController {
@RequestMapping("/boot")
public String helloBoot() {
return "Hello Spring Boot hha";
}
}
参考
https://www.cnblogs.com/zyip/p/17291390.html