diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 949c22b..e969afb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -41,17 +41,10 @@ jobs: run: | scp -o StrictHostKeyChecking=no -i pirocheck.pem backend/pirocheck/build/libs/*.jar ubuntu@${{ secrets.EC2_HOST }}:/home/ubuntu/ - - name: Run jar on EC2 + + - name: Restart Spring Boot on EC2 run: | - ssh -o StrictHostKeyChecking=no -i pirocheck.pem \ - ubuntu@${{ secrets.EC2_HOST }} \ - "fuser -k 8080/tcp || true && \ - cd /home/ubuntu && \ - nohup java -jar pirocheck-0.0.1-SNAPSHOT.jar > log.txt 2>&1 &" - - # - name: Restart Spring Boot on EC2 - # run: | - # ssh -o StrictHostKeyChecking=no -i pirocheck.pem ubuntu@${{ secrets.EC2_HOST }} 'bash ~/restart.sh' + ssh -o StrictHostKeyChecking=no -i pirocheck.pem ubuntu@${{ secrets.EC2_HOST }} 'bash ~/restart.sh' - name: Send Discord notification (Success) diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/config/WebConfig.java b/backend/pirocheck/src/main/java/backend/pirocheck/config/WebConfig.java index a6ae980..f67ed5b 100644 --- a/backend/pirocheck/src/main/java/backend/pirocheck/config/WebConfig.java +++ b/backend/pirocheck/src/main/java/backend/pirocheck/config/WebConfig.java @@ -10,7 +10,7 @@ public class WebConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/api/**") // 백엔드 API 요청에만 CORS 허용 - .allowedOrigins("http://pirocheck.org:3000") // 프론트 배포 URL + .allowedOrigins("http://pirocheck.org") // 프론트 배포 URL .allowedMethods("GET", "POST", "PUT", "DELETE") // 허용할 HTTP 메서드 .allowCredentials(true); // 세션 쿠키 주고받기 허용 } diff --git a/frontend/src/api/api.js b/frontend/src/api/api.js index 8278d08..9ba4ee2 100644 --- a/frontend/src/api/api.js +++ b/frontend/src/api/api.js @@ -1,7 +1,7 @@ import axios from "axios"; const api = axios.create({ - baseURL: "http://api.pirocheck.org/api", + baseURL: "http://api.pirocheck.org:8080/api", withCredentials: true, }); diff --git a/frontend/src/api/user.js b/frontend/src/api/user.js index 811264c..12e057a 100644 --- a/frontend/src/api/user.js +++ b/frontend/src/api/user.js @@ -1,5 +1,5 @@ export const loginUser = async ({ name, password }) => { - const res = await fetch("http://api.pirocheck.org/api/login", { + const res = await fetch("http://api.pirocheck.org:8080/api/login", { method: "POST", headers: { "Content-Type": "application/json",