diff --git a/scripts/switch.sh b/scripts/switch.sh index 5739469..2461428 100644 --- a/scripts/switch.sh +++ b/scripts/switch.sh @@ -29,7 +29,7 @@ #echo "> Nginx reloaded." #!/bin/bash echo "> 현재 구동중인 Port 확인" -CURRENT_PROFILE=$(curl -s http://localhost/profile) +CURRENT_PROFILE=$(curl -s http://localhost/api/profile) # 쉬고 있는 set 찾기: set1이 사용중이면 set2가 쉬고 있고, 반대면 set1이 쉬고 있음 if [ $CURRENT_PROFILE == set1 ] @@ -48,7 +48,7 @@ echo "> 전환할 Port: $IDLE_PORT" echo "> Port 전환" echo "set \$service_url http://127.0.0.1:${IDLE_PORT};" |sudo tee /etc/nginx/conf.d/service-url.inc -PROXY_PORT=$(curl -s http://localhost/profile) +PROXY_PORT=$(curl -s http://localhost/api/profile) echo "> Nginx Current Proxy Port: $PROXY_PORT" echo "> Nginx Reload" diff --git a/src/main/java/Plant/PlantProject/util/WebRestController.java b/src/main/java/Plant/PlantProject/util/WebRestController.java index 36bd081..7f9c09b 100644 --- a/src/main/java/Plant/PlantProject/util/WebRestController.java +++ b/src/main/java/Plant/PlantProject/util/WebRestController.java @@ -1,6 +1,7 @@ package Plant.PlantProject.util; import lombok.AllArgsConstructor; +import lombok.RequiredArgsConstructor; import org.springframework.core.env.Environment; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -9,10 +10,11 @@ import java.util.Arrays; @RestController -@AllArgsConstructor +@RequiredArgsConstructor +@RequestMapping("/api") public class WebRestController { - private Environment env; + private final Environment env; @GetMapping("/profile")