Skip to content

Commit 185e23a

Browse files
authored
Update README.md
1 parent 8cd5a2b commit 185e23a

File tree

1 file changed

+35
-25
lines changed

1 file changed

+35
-25
lines changed

MatchingService/README.md

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#### Listening port
2727

28-
http://localhost:3001
28+
http://localhost:3004
2929

3030

3131
#### Run RabbitMQ Server by:
@@ -45,23 +45,26 @@ rabbitmq-plugins enable rabbitmq_management
4545

4646
#### Start the microservice on local machine by:
4747

48-
1. Navigate to peerprep directory.
48+
1. Navigate to MatchingService directory.
4949

50-
2. Uncomment localhost addresses and comment the docker addresses for the services in the `peer-prep\src\backend\matching-service\config\config.js` file as below:
50+
2. Uncomment localhost addresses and comment the docker addresses for the services in the `MatchingService\config\config.js` file as below:
5151

5252
```
53-
mongodbUri: 'mongodb://127.0.0.1:27017/peer-prep',
54-
//mongodbUri: 'mongodb://mongo_db:27017/peer-prep',
55-
rabbitmqUrl: 'amqp://127.0.0.1:5672',
56-
//rabbitmqUrl: 'amqp://rabbitmq:5672'
53+
// questionServiceUrl: "http://question-service:3003/api/questions",
54+
questionServiceUrl: "http://127.0.0.1:3003/api/questions",
55+
// mongodbUri: "mongodb://matching-service-database:27017/peer-prep",
56+
// mongodbUri: "mongodb://127.0.0.1:27020/peer-prep",
57+
mongodbUri: "mongodb://127.0.0.1:27017/peer-prep",
58+
// rabbitmqUrl: "amqp://rabbitmq:5672",
59+
rabbitmqUrl: "amqp://127.0.0.1:5672",
5760
```
5861

5962
3. Initiate connection of local MongoDB service to address `mongodb://localhost:27017/peer-prep`.
6063

6164
4. Start the microservice in terminal using commands:
6265

6366
```
64-
cd peer-prep\src\backend\matching-service
67+
cd MatchingService
6568
npm install
6669
npm start
6770
```
@@ -72,7 +75,7 @@ npm start
7275
7376
> node server.js
7477
75-
Matching service listening on port 3001
78+
Matching service listening on port 3004
7679
MongoDB Connected: 127.0.0.1
7780
```
7881

@@ -105,13 +108,13 @@ Sample data for Question collection:
105108

106109
Send **POST** request to:
107110

108-
`http://localhost:3000/home/:UserId` and specify post fields.
111+
`http://localhost:3004/home/:UserId` and specify post fields.
109112

110113
Example:
111114

112115
Set 1 :-
113116

114-
Url link: `http://localhost:3001/home/Qa5Xb8Rv2KpL`
117+
Url link: `http://localhost:3004/home/Qa5Xb8Rv2KpL`
115118

116119
For testing using Postman, enter data using the `Body` panel (2 methods are available):
117120

@@ -139,7 +142,7 @@ Sample data for Question collection:
139142
140143
Set 2 :-
141144
142-
Url link: `http://localhost:3001/home/Zu8YkQ3mBvLx`
145+
Url link: `http://localhost:3004/home/Zu8YkQ3mBvLx`
143146
144147
For testing using Postman, enter data using the `Body` panel (2 methods are available):
145148
@@ -209,11 +212,11 @@ Sample data for Question collection:
209212
210213
Send **DELETE** request to:
211214
212-
`http://localhost:3000/home/:UserId/matching`
215+
`http://localhost:3004/home/:UserId/matching`
213216
214217
Example:
215218
216-
`http://localhost:3000/home/Zu8YkQ3mBvLx/matching`
219+
`http://localhost:3004/home/Zu8YkQ3mBvLx/matching`
217220
218221
Server response :-
219222
@@ -233,13 +236,17 @@ Sample data for Question collection:
233236
}
234237
```
235238
239+
Note:
240+
241+
> For other test, please refer to the project report appendix.
242+
236243
237244
#### Jest testing
238245
239246
1. Test the service using terminal commands:
240247
241248
```
242-
cd peer-prep\src\backend\matching-service
249+
cd MatchingService
243250
npm test
244251
```
245252
@@ -248,23 +255,26 @@ npm test
248255
249256
**Note**:
250257
251-
> Please delete the containers for other microservices.
258+
> Please ensure that there are no active container of the required services.
252259
253-
1. Navigate to peerprep directory.
260+
1. Navigate to MatchingService directory.
254261
255-
2. Comment localhost addresses and uncomment the docker addresses for the service in the `peer-prep\src\backend\matching-service\config\config.js` file as below:
262+
2. Comment localhost addresses and uncomment the docker addresses for the service in the `MatchingService\config\config.js` file as below, it sometimes use local addresses depend on different configuration of machine / docker:
256263
257264
```
258-
//mongodbUri: 'mongodb://127.0.0.1:27017/peer-prep',
259-
mongodbUri: 'mongodb://mongo_db:27017/peer-prep',
260-
//rabbitmqUrl: 'amqp://127.0.0.1:5672',
261-
rabbitmqUrl: 'amqp://rabbitmq:5672'
265+
questionServiceUrl: "http://question-service:3003/api/questions",
266+
// questionServiceUrl: "http://127.0.0.1:3003/api/questions",
267+
mongodbUri: "mongodb://matching-service-database:27017/peer-prep",
268+
// mongodbUri: "mongodb://127.0.0.1:27020/peer-prep",
269+
// mongodbUri: "mongodb://127.0.0.1:27017/peer-prep",
270+
rabbitmqUrl: "amqp://rabbitmq:5672",
271+
//rabbitmqUrl: "amqp://127.0.0.1:5672",
262272
```
263273
264274
4. Start the microservice in terminal using commands:
265275
266276
```
267-
cd peer-prep\src\backend\matching-service
277+
cd MatchingService
268278
docker-compose up --build
269279
```
270280
@@ -273,8 +283,8 @@ docker-compose up --build
273283
```
274284
275285
> node server.js
276-
> Matching service listening on port 3001
277-
> MongoDB Connected: mongo_db
286+
> Matching service listening on port 3004
287+
> MongoDB Connected: matching-service-database
278288
```
279289
280290
6. End matching service in terminal using `Ctrl+C` twice.

0 commit comments

Comments
 (0)