创建新项目

 
 
启动端口
在项目配置文件application.properties中写入
    #启动端口
    server.port=8088

编写测试方法
创建控制类文件夹–>便于规范我们新建一个controller包–>建一个HelloWorld.class
package com.example.hellospringboot.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@ResponseBody
@RequestMapping("/hey")
public class HelloWorld {
    @RequestMapping("/heyWorld")
    public String heyWorld(){
        return "Hello World";
    }
}
启动测试
运行启动类
 
 打开浏览器输入http://localhost:8088/hey/heyWorld回车如下
 



















