feat: 增加检测服务健康的HealthController
This commit is contained in:
parent
99281f8166
commit
fe4546e2b5
@ -32,6 +32,7 @@ public class SecurityConfig {
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
.requestMatchers("/login").permitAll()
|
||||
.requestMatchers("/device_image/**").permitAll()
|
||||
.requestMatchers("/health").permitAll()
|
||||
.anyRequest().authenticated())
|
||||
.addFilterBefore(jwtAuthFilter(), UsernamePasswordAuthenticationFilter.class)
|
||||
.build();
|
||||
|
@ -0,0 +1,14 @@
|
||||
package github.benjamin.equipreservebackend.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class HealthController {
|
||||
|
||||
@GetMapping("/health")
|
||||
public String health() {
|
||||
return "ok";
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user