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:

 健康监测:

原文地址:https://www.cnblogs.com/Brake/p/11832099.html