[英]Is it possible to change the /health endpoint in spring-boot?
I have a spring-boot-web application and I am using actuator to check status of my application. 我有一个spring-boot-web应用程序,我正在使用执行器来检查我的应用程序的状态。 Whenever I do /health I am able to check the status of my application.
每当我做健康时,我都可以检查我的申请状态。 My doubt is, is it possible to change the /health endpoint to something like /ABC/health(I need to add context to /health).
我的疑问是,是否可以将/ health端点更改为/ ABC / health(我需要将上下文添加到/ health)。 Is it possible or do I need to have a controller for this and need to handle it.
是否可能或者我需要有一个控制器,需要处理它。
You can use a built-in property to expose all Actuator endpoints under different path. 您可以使用内置属性公开不同路径下的所有Actuator端点。 Just set it in your application.properties file:
只需在application.properties文件中设置它:
management.context-path=/ABC
The health will be than available under /ABC/health
. 健康状况将超过
/ABC/health
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.