Spring boot CLI
CLI是Command Line Interface缩写,使用Sprint Boot CLI可以使得用于以一种及其简单的方式开始spring的项目。
安装
-
直接从spring下载解压安装: https://repo.spring.io/release/org/springframework/boot/spring-boot-cli/1.5.9.RELEASE/spring-boot-cli-1.5.9.RELEASE-bin.zip
-
配置PATH环境变量
快速开始
创建一个application.groovy文件,具体内容如下:
@RestController
class HelloWorld{
@RequestMapping("/")
def sayhello(){
return "hello liumiaocn"
}
}
运行
spring run application.groovy
访问:
curl http://localhost:8080
来源:oschina
链接:https://my.oschina.net/u/1162040/blog/1593646