SpringBoot:第一篇 新建spring boot 应用

1.idea 新建spring boot项目 File-> new Project

SpringBoot:第一篇 新建spring boot 应用

2.web 应用---选择web应用

SpringBoot:第一篇 新建spring boot 应用

SpringBoot:第一篇 新建spring boot 应用

3.Controller

SpringBoot:第一篇 新建spring boot 应用

package com.example.demo.controller;

/**
 * @author duanxiaoqiu
 * @Date 2019-06-14 15:05
 **/

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/")
public class TestController {

    @RequestMapping("/")
    @ResponseBody
    public String index(){
        //log.info("++++");
        return "hello world";
    }

}
4.结果 http://localhost:8080/

SpringBoot:第一篇 新建spring boot 应用