- Mastering Spring Boot 2.0
- Dinesh Rajput
- 140字
- 2021-06-25 21:29:20
Changing endpoint IDs
As you have seen in the table of all Actuator endpoints, each of the Actuator endpoints has an ID that is used to call that endpoint as a REST service. For example /health, /metrics, and /beans endpoints have health, metrics, and beans, respectively, as their IDs. But you can change this endpoint ID and set what you want for your application as follows:
endpoints.endpoint-id.id=new_id
For example, let's customize the ID of the /health endpoint. Now I want to change it to GET requests sent to /status. In the application.properties file, it looks like this:
health.id = status
In the application.yml file, it looks like this:
health: id: status
Now you can check the health of your application by using the /status custom endpoint. It will work the same as the /health endpoint.
推薦閱讀
- Word/Excel/PPT 2007辦公技巧
- 新編電腦辦公(Windows 10 + Office 2010版)從入門到精通
- Office 2019高效辦公三合一從入門到精通(視頻自學版)
- Office 2013輕松辦公:Word/Excel/PowerPoint三合一超級應用大全(實戰案例版)
- Excel公式與函數從入門到精通
- Word/Excel/PPT實戰技術大全
- 財務必須知道的115個Excel函數
- 新編Office 2013從入門到精通
- Word/Excel 2010辦公應用實戰從入門到精通
- Excel 2010高效辦公:市場與銷售管理
- 別讓PPT拖后腿
- 巧學巧用Excel函數:掌握核心技能,秒變數據分析高手
- Hands-On Kubernetes on Azure
- 巧學活用Word
- PowerPivot for Advanced Reporting and Dashboards