File tree Expand file tree Collapse file tree 6 files changed +18
-17
lines changed Expand file tree Collapse file tree 6 files changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ EXPRESS_PORT=9004
5
5
MATCHING_DB_HOSTNAME=host.docker.internal
6
6
MATCHING_DB_PORT=6379
7
7
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
11
11
12
12
# MATCHING_DB_USERNAME=peerprep-match-express
13
13
# MATCHING_DB_PASSWORD=G7jBgyz9wGAFQ5La
Original file line number Diff line number Diff line change @@ -5,9 +5,11 @@ EXPRESS_PORT=9004
5
5
MATCHING_DB_HOSTNAME = " localhost"
6
6
MATCHING_DB_PORT = 6379
7
7
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
+
11
13
12
14
13
15
# MATCHING_DB_USERNAME="peerprep-match-express"
Original file line number Diff line number Diff line change 1
1
import axios from 'axios' ;
2
+ import { PEERPREP_COLLAB_HOST } from '@/config' ;
2
3
3
- const collabServerEndpoint = `${ process . env . COLLAB_SERVER_ENDPOINT } ` ;
4
4
5
5
export async function createRoom ( userId1 : string , userId2 : string , questionId : string ) : Promise < string > {
6
6
const response = await axios . get < { roomName : string } > (
7
- `${ collabServerEndpoint } /room` ,
7
+ `${ PEERPREP_COLLAB_HOST } /room` ,
8
8
{
9
9
params : {
10
10
userid1 : userId1 ,
Original file line number Diff line number Diff line change 1
1
import axios from 'axios' ;
2
2
import { IServiceResponse , IQuestion , IGetRandomQuestionPayload } from '../types/index' ;
3
-
4
- const questionEndpoint = `${ process . env . QUESTION_SERVER_ENDPOINT } ` ;
3
+ import { PEERPREP_QUESTION_HOST } from '@/config' ;
5
4
6
5
export async function getRandomQuestion ( payload : IGetRandomQuestionPayload ) : Promise < IQuestion > {
7
6
const response = await axios . post < IServiceResponse < { question : IQuestion } > > (
8
- `${ questionEndpoint } /questions/random` ,
7
+ `${ PEERPREP_QUESTION_HOST } /questions/random` ,
9
8
payload
10
9
) ;
11
10
Original file line number Diff line number Diff line change 1
1
import axios from 'axios' ;
2
2
3
- const userEndpoint = ` ${ process . env . USER_SERVER_ENDPOINT } ` ;
3
+ import { PEERPREP_USER_HOST } from '@/config' ;
4
4
5
5
export async function fetchAttemptedQuestions ( userId : string ) : Promise < number [ ] > {
6
6
const response = await axios . post < number [ ] > (
7
- `${ userEndpoint } /user/attempted-question/get` ,
7
+ `${ PEERPREP_USER_HOST } /user/attempted-question/get` ,
8
8
{ userId}
9
9
) ;
10
10
if ( response . status !== 200 || ! response . data ) {
@@ -15,7 +15,7 @@ export async function fetchAttemptedQuestions(userId: string): Promise<number[]>
15
15
16
16
export async function updateAttemptedQuestions ( userIds : string [ ] , questionId : number ) : Promise < void > {
17
17
const response = await axios . post < unknown > (
18
- `${ userEndpoint } /user/attempted-question/add` ,
18
+ `${ PEERPREP_USER_HOST } /user/attempted-question/add` ,
19
19
{ questionId, userIds }
20
20
) ;
21
21
if ( response . status !== 200 || ! response . data ) {
Original file line number Diff line number Diff line change @@ -187,9 +187,9 @@ services:
187
187
- MATCHING_DB_HOSTNAME=match-db
188
188
- MATCHING_DB_PORT=6379
189
189
- 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}
193
193
depends_on :
194
194
- match-db
195
195
- user-service
You can’t perform that action at this time.
0 commit comments