# spring-boot-demo-helloworld
## Runing spring boot demo helloworld
```sh
$ mvn spring-boot:run
```
##
> 本 demo 演示如何使用 Spring Boot 写一个hello world
### pom.xml
```xml
* SpringBoot启动类 *
* * @package: com.xkcoding.helloworld * @description: SpringBoot启动类 * @author: yangkai.shen * @date: Created in 2018/9/28 2:49 PM * @copyright: Copyright (c) * @version: V1.0 * @modified: yangkai.shen */ @SpringBootApplication @RestController public class SpringBootDemoHelloworldApplication { public static void main(String[] args) { SpringApplication.run(SpringBootDemoHelloworldApplication.class, args); } /** * Hello,World * * @param who 参数,非必须 * @return Hello, ${who} */ @GetMapping("/hello") public String sayHello(@RequestParam(required = false, name = "who") String who) { if (StrUtil.isBlank(who)) { who = "World"; } return StrUtil.format("Hello, {}!", who); } } ``` ### application.yml ```yaml server: port: 8080 servlet: context-path: /demo ```