0

我必须检查我的服务/应用程序是否有效。

我添加了依赖

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>2.6.2</version>
</dependency>

并且还尝试添加management.endpoint.health.show-details: alwaysapplication.yml但没有帮助。

我试图去http://localhost:8080/actuator/healthhttp://localhost:8080/health但它返回 404 错误。

4

1 回答 1

0

默认情况下,Spring Boot 为所有执行器端点启用安全性

您可以使用以下属性禁用该功能

management.security.enabled=false  

此后,尝试运行应用程序并点击端点

http://localhost:8080/actuator

如果可行,请投票:)

于 2022-01-10T13:30:27.640 回答