

这里我没有连阿里云的镜像,因为挂了梯子,所以速度虽然比阿里云慢一些,但是速度也还行,而且可以保证纯度。

总共下载了 4 分钟左右,时间可以接受。

添加代码

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| package com.fan.springbootdemo;
import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication @RestController public class SpringbootdemoApplication {
public static void main(String[] args) { SpringApplication.run(SpringbootdemoApplication.class, args); }
@GetMapping("/hello") public String hello(@RequestParam(value = "name", defaultValue = "World") String name) { return String.format("Hello %s!", name); }
}
|
然后,运行项目,这清爽的控制台真是赏心悦目

在浏览器中访问 localhost:8080/hello
,效果如下
