(新手向)SpringBoot+MyBatis从0开始搭建博客系统(一)创建初始项目

152 阅读1分钟

1.创建项目 快速创建网址:start.spring.io/

2.打开项目 起初项目由于镜像的原因,速度非常非常慢,大家可以修改maven的镜像源。

3.新建controller包,添加测试类,可以简单测试整个项目是否构建成功

image.png

@RestController
@RequestMapping("/test")
public class TestController {
    @GetMapping("/hello")
    public String test() {
        return "hello world";
    }
}

修改application.properties的后缀为yml

image.png

可以指定端口号

image.png

4.启动项目,访问接口 image.png

image.png