Skip to content

Commit 9afeeb2

Browse files
authored
Update api-strategy.md
1 parent a74d1bc commit 9afeeb2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docs/api-strategy.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,28 @@ NOTE: you can even implement the `IApiCallStrategy`, the `IEventStrategy` or ext
2727
The library also provides a wrapper to define the useFactory by passing typed parameters:
2828

2929

30-
For the local call
30+
#### For the local call
3131
```typescript
3232
NestLocalCallStrategyProvider('YOUR_LOCAL_CALL_PROVIDER_ID', {
3333
NestLocalStrategy: NestLocalCallStrategy,
3434
baseUrl: '/',
3535
})
3636
```
3737

38-
For the HTTP calls
38+
NOTE: You need to import the module containing the controller you are calling via the local-strategy to make it work. It's important to understand that the http call is emulated within the same runtime scope, so you will practically import both modules in the same app (the caller and the receiver).
39+
40+
#### For the HTTP calls
3941
```typescript
4042
NestHttpCallStrategyProvider('YOUR_HTTP_CALL_PROVIDER_ID', {
4143
NestHttpStrategy: NestHttpCallStrategy,
4244
baseUrl: 'http://youdomain.com/',
4345
});
4446
```
4547

48+
NOTE: You need to import the `HttpModule` from the [nestjs library](https://docs.nestjs.com/techniques/http-module) to make it work
49+
4650

47-
For the event strategy
51+
#### For the event strategy
4852
```typescript
4953
NestLocalEventStrategyProvider('YOUR_LOCAL_EVENT_PROVIDER_ID', {
5054
NestLocalStrategy: NestLocalEventStrategy,

0 commit comments

Comments
 (0)