Spring(001)-Hello Spring

Spring系列第一篇,先通过Spring实现一个Hello Spring程序。

访问 https://start.spring.io/ 开始spring代码骨架的构建。

输入mvn坐标

 

 加入web和actuator的依赖。

 

code:

复制代码
@SpringBootApplication
@RestController
public class HelloSpringApplication {

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

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

}
复制代码

run:

 

 

result:

 

 健康监测:

 

posted @   ibrake  阅读(179)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示