diff --git a/src/main/java/github/benjamin/equipreservebackend/config/SecurityConfig.java b/src/main/java/github/benjamin/equipreservebackend/config/SecurityConfig.java index 26b50ab..fb1ecda 100644 --- a/src/main/java/github/benjamin/equipreservebackend/config/SecurityConfig.java +++ b/src/main/java/github/benjamin/equipreservebackend/config/SecurityConfig.java @@ -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(); diff --git a/src/main/java/github/benjamin/equipreservebackend/controller/HealthController.java b/src/main/java/github/benjamin/equipreservebackend/controller/HealthController.java new file mode 100644 index 0000000..7e345bc --- /dev/null +++ b/src/main/java/github/benjamin/equipreservebackend/controller/HealthController.java @@ -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"; + } + +}