@@ -147,18 +147,18 @@ export class AnotherService {
147
147
You can customize logging and request/response interceptors by providing ` logger ` and ` config ` options during module initialization.
148
148
149
149
``` typescript
150
- import { Logger } from ' @nestjs/common' ;
151
- import { Module } from ' @nestjs/common' ;
152
- import { HttpModule } from ' @nodeflip/nest-axios-http' ;
150
+ import { Logger } from " @nestjs/common" ;
151
+ import { Module } from " @nestjs/common" ;
152
+ import { HttpModule } from " @nodeflip/nest-axios-http" ;
153
153
154
- const customLogger = new Logger (' CustomLogger' );
154
+ const customLogger = new Logger (" CustomLogger" );
155
155
156
156
@Module ({
157
157
imports: [
158
158
HttpModule .forRoot ({
159
- logger: customLogger , // Custom logger instance
159
+ logger: customLogger , // Custom logger instance
160
160
config: {
161
- baseURL: ' https://api.example.com' ,
161
+ baseURL: " https://api.example.com" ,
162
162
enableLogging: true ,
163
163
onRequest : (config ) => {
164
164
// Customize request logging or modifications
@@ -177,21 +177,22 @@ const customLogger = new Logger('CustomLogger');
177
177
],
178
178
})
179
179
export class AppModule {}
180
+
180
181
```
181
182
### Configuring Multiple HTTP Services
182
183
183
184
You can configure multiple HTTP services using an array of options with forFeature.
184
185
``` typescript
185
- import { Module } from ' @nestjs/common' ;
186
- import { HttpModule } from ' @nodeflip/nest-axios-http' ;
186
+ import { Module } from " @nestjs/common" ;
187
+ import { HttpModule } from " @nodeflip/nest-axios-http" ;
187
188
188
189
@Module ({
189
190
imports: [
190
191
HttpModule .forFeature ([
191
192
{
192
- serviceName: " HTTP_SERVICE_2" ,
193
+ serviceName: " HTTP_SERVICE_2" ,
193
194
config: {
194
- baseURL: ' https://api.service1.com' ,
195
+ baseURL: " https://api.service1.com" ,
195
196
enableLogging: true ,
196
197
onRequest : (config ) => {
197
198
// Optional: Customize request logging or modifications
@@ -208,9 +209,9 @@ import { HttpModule } from '@nodeflip/nest-axios-http';
208
209
},
209
210
},
210
211
{
211
- serviceName: " HTTP_SERVICE_2" ,
212
+ serviceName: " HTTP_SERVICE_2" ,
212
213
config: {
213
- baseURL: ' https://api.service2.com' ,
214
+ baseURL: " https://api.service2.com" ,
214
215
enableLogging: true ,
215
216
onRequest : (config ) => {
216
217
// Optional: Customize request logging or modifications
0 commit comments