启动一个springboot项目
最终效果
在idea中
package com.fqs.helloworld.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloController { @GetMapping("/hello") public String hello(){ return "hello world"; } }
package com.fqs.helloworld; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class HelloworldApplicationTests { @Test void contextLoads() { } }