-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#17 feat: health check를 위한 WebRestController 생성 및 actuator 라이브러리 의존성 추가
- Loading branch information
Showing
3 changed files
with
64 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/com/example/cherrypickserver/global/presentation/WebRestController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.example.cherrypickserver.global.presentation; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.core.env.Environment; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.Arrays; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
public class WebRestController { | ||
|
||
private final Environment environment; | ||
|
||
@GetMapping("/profile") | ||
public String getProfile() { | ||
return Arrays.stream(environment.getActiveProfiles()).findFirst().orElse(""); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters