springboot抛出contextpath must start with xx and not end with xx异常

该异常属于项目配置的根路径出错

解决问题的办法

  1. application.yml 中将 server.servlet.context-path 设置的路径前加一个 /
1
2
3
server:
  servlet:
    context-path: /api