Skip to content

Commit 8f9aa49

Browse files
committed
feat: 배포환경 ws 설정
1 parent a5e8a02 commit 8f9aa49

4 files changed

Lines changed: 7 additions & 2 deletions

File tree

.env.development

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Development environment variables
2+
VITE_WEBSOCKET_URL=http://localhost:8081/ws/chat

.env.production

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Production environment variables
2+
VITE_WEBSOCKET_URL=wss://api.sysonetaskmanager.store/ws

src/components/project/ProjectTable.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
const socketimport React from 'react';
22
import { createColumnHelper } from '@tanstack/react-table';
33
import { useNavigate } from 'react-router-dom';
44
import { MoreVert } from '@mui/icons-material';

src/store/chatStore.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ const useChatStore = create((set, get) => ({
7272
get().unsubscribeAll();
7373
return;
7474
}
75-
const socket = new SockJS('http://localhost:8081/ws/chat');
75+
const websocketUrl = import.meta.env.VITE_WEBSOCKET_URL || 'http://localhost:8081/ws/chat';
76+
const socket = new SockJS(websocketUrl);
7677
stompClient = Stomp.over(socket);
7778
stompClient.connect({}, () => {
7879
set({ isConnected: true });

0 commit comments

Comments
 (0)