Skip to content

Commit 4345f26

Browse files
committed
docs: mention global option for NarangoModule
1 parent d7987fb commit 4345f26

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,25 @@ export class MyAppModule {}
5353

5454
For sake of simplicity the database credentials are passed directly to the register function in the example but in a production environment you'd want to use [`@nestjs/config`](https://docs.nestjs.com/techniques/configuration) instead.
5555

56+
`NarangoModule` can be registered as a global module through the `global` option:
57+
58+
```ts
59+
imports: [
60+
NarangoModule.register({
61+
global: true,
62+
database: {
63+
url: "http://localhost:8529",
64+
databaseName: "MyDatabase",
65+
auth: {
66+
username: "userDB",
67+
password: "secretPassword",
68+
},
69+
},
70+
}),
71+
],
72+
73+
```
74+
5675
## Inject NarangoService
5776

5877
Now you can access the `NarangoService` everywhere you need it in your application:

0 commit comments

Comments
 (0)