Skip to content

Commit

Permalink
Merge pull request #14 from ronati/beta
Browse files Browse the repository at this point in the history
docs: mention global option for NarangoModule
  • Loading branch information
Nargonath authored Oct 26, 2023
2 parents a22f76a + 4345f26 commit 1861de6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,25 @@ export class MyAppModule {}

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.

`NarangoModule` can be registered as a global module through the `global` option:

```ts
imports: [
NarangoModule.register({
global: true,
database: {
url: "http://localhost:8529",
databaseName: "MyDatabase",
auth: {
username: "userDB",
password: "secretPassword",
},
},
}),
],

```

## Inject NarangoService

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

0 comments on commit 1861de6

Please sign in to comment.