Skip to content

Commit 185f05e

Browse files
committed
chore: 요청 url 수정
- 소켓 및 http 요청 url 앞에 /api 추가
1 parent 766e62f commit 185f05e

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/api/CheckExistsRoomByRoomId.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const CheckExistsRoomByRoomId = async (
44
roomId: string,
55
): Promise<boolean> => {
66
try {
7-
const response = await axiosInstance.get(`/room/${roomId}`);
7+
const response = await axiosInstance.get(`/api/room/${roomId}`);
88
return response.status === 200;
99
} catch (error) {
1010
return false;

src/api/CheckNickname.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const CheckNicknameDuplicate = async (
55
nickname: string
66
): Promise<boolean> => {
77
try {
8-
const response = await axiosInstance.get(`/room/${roomId}/${nickname}`);
8+
const response = await axiosInstance.get(`/api/room/${roomId}/${nickname}`);
99
const { duplicate } = response.data;
1010
return duplicate;
1111
} catch (error) {

src/api/CreateRoom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const createRoom = async (
4545
try {
4646
const requestBody = buildRequestBody(gameType, nickname, gameTime);
4747

48-
const response = await axiosInstance.post<CreateRoomResponse>('/room', requestBody);
48+
const response = await axiosInstance.post<CreateRoomResponse>('/api/room', requestBody);
4949

5050
console.log('Room created successfully:', response.data);
5151
return response.data.roomId; // 서버에서 반환된 roomId를 사용

src/api/ReadAllRoom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import axiosInstance from './axiosInstance';
33

44
export const ReadAllRoom = async (): Promise<GameState[]> => {
55
try {
6-
const response = await axiosInstance.get(`/room`);
6+
const response = await axiosInstance.get(`/api/room`);
77
const rooms: GameState[] = response.data;
88
return rooms;
99
} catch (error) {

src/services/OneVsOneWebSocket.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class OneVsOneWebSocket extends WebSocketManager {
4040
console.log('WebSocket connected:', frame);
4141

4242
// 방 정보 구독
43-
this.subscribe(`/topic/room/${this.roomId}`, (message) => {
43+
this.subscribe(`/api/topic/room/${this.roomId}`, (message) => {
4444
this.processData(message);
4545
});
4646

@@ -128,7 +128,7 @@ class OneVsOneWebSocket extends WebSocketManager {
128128
nickname: this.nickname,
129129
};
130130

131-
this.sendMessage('/app/room/enter', requestBody);
131+
this.sendMessage('/api/app/room/enter', requestBody);
132132
} else {
133133
console.error('Room ID or Nickname is not set');
134134
}
@@ -137,7 +137,7 @@ class OneVsOneWebSocket extends WebSocketManager {
137137
// 방장 게임 시작 요청
138138
startGameRequest() {
139139
if (this.roomId) {
140-
this.sendMessage(`/app/start/${this.roomId}`);
140+
this.sendMessage(`/api/app/start/${this.roomId}`);
141141
} else {
142142
console.error('Room ID is not set');
143143
}
@@ -146,7 +146,7 @@ class OneVsOneWebSocket extends WebSocketManager {
146146
// 플레이어 준비 요청
147147
playerReadyRequest() {
148148
if (this.roomId) {
149-
this.sendMessage(`/app/start/${this.roomId}/${this.nickname}`);
149+
this.sendMessage(`/api/app/start/${this.roomId}/${this.nickname}`);
150150
} else {
151151
console.error('Room ID is not set');
152152
}
@@ -155,7 +155,7 @@ class OneVsOneWebSocket extends WebSocketManager {
155155
// 클릭 이벤트 전송
156156
sendClickEvent() {
157157
if (this.roomId) {
158-
this.sendMessage(`/app/click/${this.roomId}/${this.nickname}`);
158+
this.sendMessage(`/api/app/click/${this.roomId}/${this.nickname}`);
159159
} else {
160160
console.error('Room ID is not set');
161161
}

0 commit comments

Comments
 (0)