启动一个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() {
    }

}

 

posted @ 2023-09-18 18:26  胖豆芽  阅读(9)  评论(0编辑  收藏  举报