Skip to content

Commit

Permalink
Update ProfileController.java
Browse files Browse the repository at this point in the history
  • Loading branch information
juno-junho authored Apr 16, 2024
1 parent a36a276 commit f99e13e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

@RestController
@RequiredArgsConstructor
@RequestMapping("/api")
public class ProfileController {

private static final List<String> BLUE_GREEN = List.of("blue", "green");

private final Environment env;

@GetMapping("/profile")
public String profile() {
return Arrays.stream(env.getActiveProfiles())
.filter(BLUE_GREEN::contains)
.findAny()
.orElseGet(() -> " ");
}
Expand Down

0 comments on commit f99e13e

Please sign in to comment.