启动一个springboot项目

发布时间 2023-09-18 18:31:33作者: 无知者无畏123

最终效果

 在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() {
    }

}