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
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:

- name: Build application
run: npm run build
env: │
VITE_API_BASE_URL: ${{ secrets.VITE_API_BASE_URL }} │
VITE_API_WS_URL: ${{ secrets.VITE_API_WS_URL }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand Down
94 changes: 93 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@
"dependencies": {
"@stomp/stompjs": "^7.1.1",
"axios": "^1.11.0",
"date-fns": "^4.1.0",
"lodash.debounce": "^4.0.8",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-intersection-observer": "^9.16.0",
"react-router-dom": "^7.7.1",
"sockjs-client": "^1.6.1"
"react-virtualized-auto-sizer": "^1.0.26",
"react-window": "^1.8.11",
"sockjs-client": "^1.6.1",
"uuid": "^11.1.0"
},
"devDependencies": {
"@eslint/js": "^9.30.1",
Expand Down
1 change: 1 addition & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function App() {
<Route path="/draft/:draftId" element={<Draft />} />
<Route path="/waiting" element={<Waiting />} />
<Route path="/chatroom" element={<Chatroom />} />
<Route path="/chatroom/:roomId" element={<Chatroom />} />
<Route path="/auth/callback" element={<AuthCallback />} />
</Routes>
</BrowserRouter>
Expand Down
30 changes: 30 additions & 0 deletions src/api/axiosConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// src/api/axiosConfig.js
import axios from 'axios';

// 백엔드 API의 기본 URL
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:8080';

const axiosInstance = axios.create({
baseURL: API_BASE_URL,
});

// 요청 인터셉터 (요청을 보내기 전에 실행)
axiosInstance.interceptors.request.use(
(config) => {
// localStorage에서 accessToken 가져오기
const accessToken = localStorage.getItem('accessToken');

// 토큰이 존재하면 Authorization 헤더에 추가
if (accessToken) {
config.headers['Authorization'] = `Bearer ${accessToken}`;
}

return config;
},
(error) => {
// 요청 에러 처리
return Promise.reject(error);
}
);

export default axiosInstance;
2 changes: 2 additions & 0 deletions src/api/axiosInstance.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import axios from 'axios';

// 백엔드 API의 기본 URL

const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || ''; // ALB의 Path-based 라우팅을 위해 상대 경로 사용


const axiosInstance = axios.create({
baseURL: API_BASE_URL,
});
Expand Down
Loading