源码地址:https://github.com/roncoo/spring-boot-demojava
1、搭建一个简单的RESTfull API接口项目git
1. spring-boot-starter-web的引入,其依赖包的学习github
2. spring-boot-devtools的引入,其依赖包的学习web
3. 代码的实现spring
4. 运行项目maven
直接运行main方法或者使用maven命令: spring-boot:runspring-boot
测试: http://localhost:8080/index学习
带参数:http://localhost:8080/index/get?name=wujing测试
带参数有中文:http://localhost:8080/index/get?name=无境url
url测试:http://localhost:8080/index/get/1/wujing
url测试:http://localhost:8080/index/get/1/无境
5.打包
命令: clean package
6.运行命令: java –jar roncoo-education-0.0.1-SNAPSHOT.jar