新建项目
本文采用 JDK17 搭建。
常用设置
- 设置字符集
- 开启注解处理
- 删除不需要的文件
设置 maven与 jdk版本
菜单栏:File->Project Structure
健康检查
@SpringBootApplication
@RestController
public class SpringKitApplication {
public static void main(String[] args) {
SpringApplication.run(SpringKitApplication.class, args);
}
@GetMapping("/health-check")
public String healthCheck() {
return "OK";
}
}
启动并访问
http://localhost:8080/health-check