SpingBoot-HelloWorld创建

来源:互联网 发布:直接消耗系数矩阵 编辑:程序博客网 时间:2024/06/05 14:28

FILE-NEW-PROJECT-SpringInitializr-NEXT-填写gourpId/Artiface-NEXT-选择WEB,SpringBoot创建成功

编写HelloController

@RestControllerpublic class HelloController {    @RequestMapping("/")    public String index(){        return "hello world";    }}

启动自动生成的Application-mian()方法

@SpringBootApplicationpublic class SpringbootdemoApplication {    public static void main(String[] args) {        SpringApplication.run(SpringbootdemoApplication.class, args);    }}

在浏览器输入地址

这里写图片描述

springboot-helloworld例子创建成功