23
23
24
24
#### Listening port
25
25
26
- http://localhost:3004
26
+ http://localhost:3008
27
27
28
28
29
29
#### Start the microservice on local machine by:
30
30
31
- 1 . Navigate to peerprep directory.
31
+ 1 . Navigate to GptService directory.
32
32
33
- 2 . Insert your own GPT-API_KEY for the services in the ` peer-prep\src\backend\gpt-service \config\config.js` file as below:
33
+ 2 . Insert your own GPT-API_KEY for the services in the ` GptService \config\config.js` file as below:
34
34
35
35
```
36
36
const API_KEY = '<Your api key>';
37
37
```
38
+
39
+ Warning:
40
+
41
+ > Please do not publish your API key to public.
42
+
38
43
39
44
3 . Start the microservice in terminal using commands:
40
45
41
46
```
42
- cd peer-prep\src\backend\gpt-service
47
+ cd GptService
43
48
npm install
44
49
npm start
45
50
```
@@ -50,7 +55,7 @@ npm start
50
55
51
56
> node server.js
52
57
53
- GPT service listening on port 3004
58
+ GPT service listening on port 3008
54
59
```
55
60
56
61
5 . End generative AI service in terminal using ` Ctrl+C ` .
@@ -66,11 +71,11 @@ GPT service listening on port 3004
66
71
67
72
Send ** POST** request to:
68
73
69
- ` http://localhost:3004 /generate ` and specify post fields.
74
+ ` http://localhost:3008 /generate ` and specify post fields.
70
75
71
76
Example:
72
77
73
- Url link: ` http://localhost:3004 `
78
+ Url link: ` http://localhost:3008 `
74
79
75
80
For testing using Postman, enter data using the ` Body ` panel (2 methods are available):
76
81
@@ -115,11 +120,11 @@ GPT service listening on port 3004
115
120
116
121
Send **DELETE** request to:
117
122
118
- `http://localhost:3004 /exitGpt`
123
+ `http://localhost:3008 /exitGpt`
119
124
120
125
Example:
121
126
122
- `http://localhost:3004 /exitGpt`
127
+ `http://localhost:3008 /exitGpt`
123
128
124
129
raw:
125
130
@@ -145,11 +150,11 @@ GPT service listening on port 3004
145
150
146
151
Send **GET** request to:
147
152
148
- `http://localhost:3004 /getCache`
153
+ `http://localhost:3008 /getCache`
149
154
150
155
Example:
151
156
152
- `http://localhost:3004 /getCache`
157
+ `http://localhost:3008 /getCache`
153
158
154
159
raw:
155
160
@@ -190,7 +195,7 @@ GPT service listening on port 3004
190
195
1. Test the service using terminal commands:
191
196
192
197
```
193
- cd peer-prep\src\backend\gpt-service
198
+ cd GptService
194
199
npm test
195
200
```
196
201
@@ -199,20 +204,24 @@ npm test
199
204
200
205
**Note**:
201
206
202
- > Please delete the containers for other microservices .
207
+ > Please ensure that there are no active container of the required services .
203
208
204
- 1. Navigate to peerprep directory.
209
+ 1. Navigate to GptService directory.
205
210
206
- 2. Insert your own GPT-API_KEY for the services in the `peer-prep\src\backend\gpt-service \config\config.js` file as below:
211
+ 2. Insert your own GPT-API_KEY for the services in the `GptService \config\config.js` file as below:
207
212
208
213
```
209
214
const API_KEY = '<Your api key >';
210
215
```
216
+ Warning:
217
+
218
+ > Please do not publish your API key to public.
219
+
211
220
212
221
3. Start the microservice in terminal using commands:
213
222
214
223
```
215
- cd peer-prep\src\backend\gpt-service
224
+ cd GptService
216
225
docker-compose up --build
217
226
```
218
227
@@ -221,7 +230,7 @@ docker-compose up --build
221
230
```
222
231
223
232
> node server.js
224
- > GPT service listening on port 3004
233
+ > GPT service listening on port 3008
225
234
```
226
235
227
- 5. End matching service in terminal using `Ctrl+C` twice.
236
+ 5. End GPT service in terminal using `Ctrl+C` twice.
0 commit comments