Skip to content

Commit

Permalink
infra : health check 도입
Browse files Browse the repository at this point in the history
  • Loading branch information
oownahcohc committed Mar 31, 2024
1 parent e82139b commit 16e2abf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ echo "> build jar 파일 실헹" >> $DEPLOY_LOG

CURRENT_PID=$(pgrep -f $DEPLOY_PATH)
echo "$TIME_NOW > 현재 애플리케이션이 $CURRENT_PID pid 에서 실행중입니다." >> $DEPLOY_LOG

HEALTH_CHECK=$(curl -s http://localhost/health)
echo "$HEALTH_CHECK 통과"
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package univ.earthbreaker.namu.core.api;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HealthCheckController {

@GetMapping("/health")
public ResponseEntity<String> health() {
return ResponseEntity.ok("health check");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public void addInterceptors(@NotNull InterceptorRegistry registry) {
registry.addInterceptor(authenticationInterceptor)
.addPathPatterns("/**")
.excludePathPatterns("/")
.excludePathPatterns("/health")
.excludePathPatterns("/v1/auth/login/kakao")
.excludePathPatterns("/v1/auth/reissue");
}
Expand Down

0 comments on commit 16e2abf

Please sign in to comment.