Skip to content

Commit

Permalink
chore: update README for custom loader
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikaple committed May 9, 2021
1 parent abde826 commit 51c2e0d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,19 @@ TypedConfigModule.forRoot({

### Using custom loader

If native loaders provided by `nest-typed-config` can't meet your needs,
If native loaders provided by `nest-typed-config` can't meet your needs, you can implement a custom loader. This can be achieved by providing a function which returns the configuration object synchronously or asynchronously through the `load` option. For example:

```ts
TypedConfigModule.forRoot({
schema: RootConfig,
load: async () => {
return {
host: '127.0.0.1',
port: 3000
}
},
})
```

## License

Expand Down

0 comments on commit 51c2e0d

Please sign in to comment.