Skip to content

Commit 8635c61

Browse files
authored
docs: remove installation and numbering from discovery service
1 parent 32868dc commit 8635c61

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

content/fundamentals/discovery-service.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
The `DiscoveryService` is a utility provided by `@nestjs/core` that allows developers to dynamically discover providers, controllers, and other metadata within a NestJS application. This can be particularly useful for building plugins, decorators, or features that rely on runtime introspection.
44

5-
### Installation
65

7-
`DiscoveryService` is part of `@nestjs/core`, so it does not require separate installation. You can use it directly within your NestJS application.
8-
9-
### Importing DiscoveryService and DiscoveryModule
6+
### Import Module & Service
107

118
Before using the `DiscoveryService`, you need to import the `DiscoveryModule` in your module:
129

@@ -45,7 +42,7 @@ export class ExampleService {
4542
4643
### Use Cases
4744

48-
#### 1. Discovering Providers
45+
#### Discovering Providers
4946

5047
You can retrieve all registered providers in the application:
5148

@@ -56,7 +53,7 @@ console.log(providers);
5653

5754
Each provider object contains information about the instance, token, and metadata.
5855

59-
#### 2. Discovering Controllers
56+
#### Discovering Controllers
6057

6158
Retrieve all registered controllers:
6259

@@ -65,7 +62,7 @@ const controllers = this.discoveryService.getControllers();
6562
console.log(controllers);
6663
```
6764

68-
#### 3. Finding Metadata
65+
#### Finding Metadata
6966

7067
`DiscoveryService` can help find metadata attached to providers or controllers. This is useful when working with decorators that add metadata.
7168

0 commit comments

Comments
 (0)