springboot中自定义根路径的配置

Spring boot默认是/ ,这样直接通过http://ip:port/就可以访问到index页面,如果要修改为http://ip:port/path/ 访问的话,那么需要在Application.properties文件中加入server.context-path = /你的path,比如:spring-boot,那么访问地址就是http://ip:port/spring-boot 路径。

server.context-path=/spring-boot

 

posted @ 2017-12-14 19:39  夏威夷8080  阅读(9393)  评论(0编辑  收藏  举报