Skip to content

Commit

Permalink
Merge pull request #67 from locavell/feat/#66
Browse files Browse the repository at this point in the history
[#66] 헬스 체크 API 구현
  • Loading branch information
m020202 authored Aug 18, 2024
2 parents b25f007 + d270175 commit 2cc22cf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/example/locavel/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
@@ -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<String> healthCheck() {
return ApiResponse.onSuccess("OK!!");
}
}

0 comments on commit 2cc22cf

Please sign in to comment.