官术网_书友最值得收藏!

Enabling or disabling endpoints

By default in Spring Boot, all endpoints are enabled except /shutdown, but you can disable some of them. You can also enable the /shutdown endpoint.

In the application.properties file, it would look like this:

endpoints.shutdown.enabled=true 

In the application.yml file, it would look like this:

endpoints:
   shutdown:
         enabled: true 

Similarly, you can also disable any of the other endpoints as follows:

endpoints._endpoint-id.enabled = false

In the application.yml file, it would look like this:

endpoints:
   _endpoint-id:
         enabled: false 

Let's suppose you want to disable the /health endpoint. Then in the application.properties file, you have to set the following property:

endpoints.health.enabled=true 

In application.yml, it would look like this:

endpoints:
   health:
         enabled: false 

You can also disable all endpoints at once by setting the following property to false in the application.properties file:

endpoints.enabled=false 

In the application.yml file, it would look like this:

endpoints:
   enabled: false 

As you can see, all endpoints will be disabled, so you can enable specific endpoints if you want to enable then by setting endpoints._endpoint-id.enabled = true.

主站蜘蛛池模板: 黄陵县| 神木县| 平远县| 吐鲁番市| 宣城市| 霍林郭勒市| 盐城市| 石楼县| 霸州市| 邛崃市| 黄浦区| 丽江市| 特克斯县| 镇远县| 新安县| 藁城市| 平陆县| 晋江市| 岳池县| 米脂县| 双城市| 石首市| 会泽县| 山丹县| 宜兰县| 额尔古纳市| 开江县| 普陀区| 长丰县| 佛坪县| 曲阳县| 肃宁县| 曲水县| 叙永县| 贺州市| 信丰县| 沽源县| 桃源县| 聂拉木县| 柯坪县| 科技|