springBoot-入坑第一天(idea配置)

1.新建工程

(1)File->new->project:

(2)配置编译环境

 

(3)添加服务

(4)配置工程名称

 

(5)最后finish就可以了

2.添加自己hello world 页面

(1)在要添加类的目录下,鼠标右键,选择:new->Java Class;

(2)插入代码:

package com.example.demo;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class testhello {

    @RequestMapping("/hello")
    public String hello () {
        return "hello world";
    }
}

3.运行测试:

 

猜你喜欢

转载自blog.csdn.net/qq_42099097/article/details/107430689