Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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); // 세션 쿠키 주고받기 허용
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/api/api.js
Original file line number Diff line number Diff line change
@@ -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,
});

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/api/user.js
Original file line number Diff line number Diff line change
@@ -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",
Expand Down