Skip to content

Commit

Permalink
change ep
Browse files Browse the repository at this point in the history
  • Loading branch information
LminWoo99 committed Sep 30, 2023
1 parent 0799e3b commit 74efe8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/switch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand All @@ -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"
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/Plant/PlantProject/util/WebRestController.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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")
Expand Down

0 comments on commit 74efe8b

Please sign in to comment.