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

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.

主站蜘蛛池模板: 新竹县| 新野县| 寿阳县| 思茅市| 珠海市| 云和县| 靖安县| 汝南县| 南岸区| 怀远县| 景洪市| 石台县| 修文县| 廊坊市| 富锦市| 博爱县| 轮台县| 扎兰屯市| 自治县| 竹北市| 兴隆县| 虞城县| 辽源市| 香河县| 四会市| 拜泉县| 大方县| 苏尼特右旗| 瑞丽市| 日喀则市| 辽阳县| 吉安市| 灵宝市| 舟山市| 繁峙县| 石阡县| 新津县| 甘泉县| 伊吾县| 扎囊县| 大埔县|