为什么我需要春天启动restful api的上下文根?

时间:2017-04-15 03:23:39

标签: rest spring-boot

在spring boot中构建restful api时,我们可以配置contextRoot路径,例如:

http://customer-api:8080/customer-api/

为什么我需要一个上下文根?我可以使用:

http://customer-api:8080/

只是想了解。

1 个答案:

答案 0 :(得分:0)

您不需要上下文根。 server.context-path的Spring Boot默认值为/。如果要在承载不同上下文根下的多个应用程序的域下部署应用程序,则只需要上下文根。不过,这是一个相当普遍的情况。

相关问题