Skip to content

Commit

Permalink
fix: Added app get current color in app (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolagospagopa authored Jun 21, 2022
1 parent 877604b commit 24e41bd
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
Expand All @@ -13,6 +14,9 @@
@RequestMapping("/app")
public class AppController {

@Value("${MY_APP_COLOR:}")
private String myAppColor;

@GetMapping(path = "", produces=MediaType.APPLICATION_JSON_VALUE)
public Map<String, String> mainApp()
{
Expand All @@ -36,4 +40,12 @@ public Map<String, String> envs()
});
return map;
}

@GetMapping(path = "/color", produces=MediaType.APPLICATION_JSON_VALUE)
public Map<String, String> color()
{
HashMap<String, String> map = new HashMap<>();
map.put("color", myAppColor);
return map;
}
}

0 comments on commit 24e41bd

Please sign in to comment.