0
点赞
收藏
分享

微信扫一扫

使用idea快速创建SpringBoot工程

孟佳 2022-04-26 阅读 83
java

1.新建项目

 2.代码

package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoApplication {

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

}
package com.example.demo.controller;


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

@RestController
public class QuickController {
    @RequestMapping("/quick")
    public String quick(){
        return "hello springBoot!";
    }
}

3.访问 http://localhost:8080/quick​​​​​​​

 

举报

相关推荐

0 条评论