Skip to content

Commit

Permalink
#11 [FEAT] : ProfileController 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
bbabbi committed Oct 17, 2024
1 parent dd28bc2 commit 1b30762
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.cecd.server.controller;

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 ProfileController {

private final Environment env;
private static final String NULL = "";

@GetMapping("/profile")
public String getProfile() {
return Arrays.stream(env.getActiveProfiles())
.findFirst()
.orElse(NULL);
}
}

0 comments on commit 1b30762

Please sign in to comment.