SpringBoot随笔记录

SpringBoot中自定义根路径

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

server:
  servlet:
    context-path: /demo

 

posted @ 2019-10-26 16:33  我想和这个世界谈谈,  阅读(127)  评论(0编辑  收藏  举报