diff --git a/src/main/java/com/example/locavel/config/SecurityConfig.java b/src/main/java/com/example/locavel/config/SecurityConfig.java index a4652bc..96f2074 100644 --- a/src/main/java/com/example/locavel/config/SecurityConfig.java +++ b/src/main/java/com/example/locavel/config/SecurityConfig.java @@ -82,6 +82,8 @@ public CorsConfiguration getCorsConfiguration(HttpServletRequest request) { .requestMatchers("/api/users/{user_id}/grade").permitAll() .requestMatchers("/api/users/{user_id}/grade").permitAll() .requestMatchers("/api/users/**").permitAll() + //TODO : 헬스체크용 api 허용 + .requestMatchers("/health").permitAll() .anyRequest().authenticated()) // 위의 경로 이외에는 모두 인증된 사용자만 접근 가능 .logout(logout -> logout .logoutUrl("/api/auth/logout") diff --git a/src/main/java/com/example/locavel/web/controller/HealthCheckController.java b/src/main/java/com/example/locavel/web/controller/HealthCheckController.java new file mode 100644 index 0000000..ec52d97 --- /dev/null +++ b/src/main/java/com/example/locavel/web/controller/HealthCheckController.java @@ -0,0 +1,13 @@ +package com.example.locavel.web.controller; + +import com.example.locavel.apiPayload.ApiResponse; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HealthCheckController { + @GetMapping("/health") + public ApiResponse healthCheck() { + return ApiResponse.onSuccess("OK!!"); + } +}