脚本宝典收集整理的这篇文章主要介绍了spring boot 读书笔记1-项目工程结构,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
创建项目
maven配置
<mirror> <id>alimaven</id> <mirrorOf>central</mirrorOf> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/repositories/central/</url> </mirror>
项目编码配置
修改 application.yml 文件中使用 server.port
来人为指定端口,如8001端口:
server: port: 8081
创建controller
@RestController public class HelloWordController { @RequestMapping("/hello") public String hello() { return "Welcome to the world of Spring Boot!"; } }
http://127.0.0.1:8081/hello
以上是脚本宝典为你收集整理的spring boot 读书笔记1-项目工程结构全部内容,希望文章能够帮你解决spring boot 读书笔记1-项目工程结构所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。