Skip to content

Commit 4352b5a

Browse files
committed
rename everywhere
1 parent 7f204bc commit 4352b5a

File tree

6 files changed

+18
-17
lines changed

6 files changed

+18
-17
lines changed

backend/matching/.env.docker

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ EXPRESS_PORT=9004
55
MATCHING_DB_HOSTNAME=host.docker.internal
66
MATCHING_DB_PORT=6379
77

8-
USER_SERVER_ENDPOINT=http://host.docker.internal:9001
9-
QUESTION_SERVER_ENDPOINT=http://host.docker.internal:9002
10-
COLLAB_SERVICE_ENDPOINT=http://host.docker.internal:9003
8+
PEERPREP_USER_HOST=http://host.docker.internal:9001
9+
PEERPREP_QUESTION_HOST=http://host.docker.internal:9002
10+
PEERPREP_COLLAB_HOST=http://host.docker.internal:9003
1111

1212
# MATCHING_DB_USERNAME=peerprep-match-express
1313
# MATCHING_DB_PASSWORD=G7jBgyz9wGAFQ5La

backend/matching/.env.local

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ EXPRESS_PORT=9004
55
MATCHING_DB_HOSTNAME="localhost"
66
MATCHING_DB_PORT=6379
77

8-
USER_SERVER_ENDPOINT="http://localhost:9001"
9-
QUESTION_SERVER_ENDPOINT="http://localhost:9002"
10-
COLLAB_SERVER_ENDPOINT="http://localhost:9003"
8+
9+
PEERPREP_USER_HOST="http://localhost:9001"
10+
PEERPREP_QUESTION_HOST="http://localhost:9002"
11+
PEERPREP_COLLAB_HOST="http://localhost:9003"
12+
1113

1214

1315
# MATCHING_DB_USERNAME="peerprep-match-express"

backend/matching/src/services/collab.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import axios from 'axios';
2+
import { PEERPREP_COLLAB_HOST } from '@/config';
23

3-
const collabServerEndpoint = `${process.env.COLLAB_SERVER_ENDPOINT}`;
44

55
export async function createRoom(userId1: string, userId2: string, questionId: string): Promise<string> {
66
const response = await axios.get<{ roomName: string }>(
7-
`${collabServerEndpoint}/room`,
7+
`${PEERPREP_COLLAB_HOST}/room`,
88
{
99
params: {
1010
userid1: userId1,

backend/matching/src/services/question.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import axios from 'axios';
22
import { IServiceResponse, IQuestion, IGetRandomQuestionPayload } from '../types/index';
3-
4-
const questionEndpoint = `${process.env.QUESTION_SERVER_ENDPOINT}`;
3+
import { PEERPREP_QUESTION_HOST } from '@/config';
54

65
export async function getRandomQuestion(payload: IGetRandomQuestionPayload): Promise<IQuestion> {
76
const response = await axios.post<IServiceResponse<{ question: IQuestion }>>(
8-
`${questionEndpoint}/questions/random`,
7+
`${PEERPREP_QUESTION_HOST}/questions/random`,
98
payload
109
);
1110

backend/matching/src/services/user.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import axios from 'axios';
22

3-
const userEndpoint = `${process.env.USER_SERVER_ENDPOINT}`;
3+
import { PEERPREP_USER_HOST } from '@/config';
44

55
export async function fetchAttemptedQuestions(userId: string): Promise<number[]> {
66
const response = await axios.post<number[]>(
7-
`${userEndpoint}/user/attempted-question/get`,
7+
`${PEERPREP_USER_HOST}/user/attempted-question/get`,
88
{userId}
99
);
1010
if (response.status !== 200 || !response.data) {
@@ -15,7 +15,7 @@ export async function fetchAttemptedQuestions(userId: string): Promise<number[]>
1515

1616
export async function updateAttemptedQuestions(userIds: string[], questionId: number): Promise<void> {
1717
const response = await axios.post<unknown>(
18-
`${userEndpoint}/user/attempted-question/add`,
18+
`${PEERPREP_USER_HOST}/user/attempted-question/add`,
1919
{ questionId, userIds }
2020
);
2121
if (response.status !== 200 || !response.data) {

docker-compose.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ services:
187187
- MATCHING_DB_HOSTNAME=match-db
188188
- MATCHING_DB_PORT=6379
189189
- PEERPREP_UI_HOST=http://${FRONTEND_SERVICE_NAME}:${FRONTEND_PORT}
190-
- USER_SERVER_ENDPOINT=http://${USER_SERVICE_NAME}:${USER_EXPRESS_PORT}
191-
- QUESTION_SERVER_ENDPOINT=http://${QUESTION_SERVICE_NAME}:${QUESTION_EXPRESS_PORT}
192-
- COLLAB_SERVER_ENDPOINT=http://${COLLAB_SERVICE_NAME}:${COLLAB_EXPRESS_PORT}
190+
- PEERPREP_USER_HOST=http://${USER_SERVICE_NAME}:${USER_EXPRESS_PORT}
191+
- PEERPREP_QUESTION_HOST=http://${QUESTION_SERVICE_NAME}:${QUESTION_EXPRESS_PORT}
192+
- PEERPREP_COLLAB_HOST=http://${COLLAB_SERVICE_NAME}:${COLLAB_EXPRESS_PORT}
193193
depends_on:
194194
- match-db
195195
- user-service

0 commit comments

Comments
 (0)