Skip to content

Commit db8a1d0

Browse files
committed
feat : 환경별 기본 주소 분리
1 parent 6624474 commit db8a1d0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
package com.back.global.controller;
22

3+
import org.springframework.beans.factory.annotation.Value;
4+
import org.springframework.context.annotation.Profile;
35
import org.springframework.stereotype.Controller;
46
import org.springframework.web.bind.annotation.GetMapping;
57

68
@Controller
79
public class HomeController {
810

11+
@Value("${custom.site.frontUrl}")
12+
private String frontUrl;
13+
914
@GetMapping("/")
15+
@Profile("dev")
1016
public String redirectToSwagger() {
1117
return "redirect:/swagger-ui/index.html";
1218
}
19+
20+
@GetMapping("/")
21+
@Profile("prod")
22+
public String redirectToFrontend() {
23+
return "redirect:" + frontUrl;
24+
}
1325
}

0 commit comments

Comments
 (0)