- 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.
推薦閱讀
- PERFORM-3D基本操作與實例
- Word/Excel/PPT 2013辦公應用從入門到精通
- Office 2013入門與提高
- 和秋葉一起學:秒懂WPS文字處理
- Access 2010數據庫實用教程
- Excel公式與函數大辭典
- Excel公式與函數應用技巧
- Excel 2016在會計與財務管理中的應用(微課版)
- Office辦公高手應用技巧
- Excel高效辦公:VBA范例應用(修訂版)
- 新編Word/Excel/PPT 2016高效辦公三合一(全彩版)
- PPT制作事半功倍
- 零基礎入門Python游戲
- Office2010從入門到精通(視頻講解+圖解+技巧)
- Pentaho 5.0 Reporting by Example