-
Notifications
You must be signed in to change notification settings - Fork 2
storage.StorageModule
Sclable CI edited this page Sep 11, 2024
·
198 revisions
storage.StorageModule
The main module
In the root module import StorageModule.forRootAsync()
. The module only accepts async configuration options
so provide a factory for getting the configuration.
Example: app.module.ts
import { Module } from '@nestjs/common'
import { ConfigService } from '@nestjs/config'
import { StorageModule, StorageModuleOptions, StorageType } from '@sclable/nestjs-storage'
@Module({
imports: [
// ...
StorageModule.forRootAsync({
useFactory: (config: ConfigService) => ({
...config.get<StorageModuleOptions>('storage', {
defaultDriver: StorageType.DUMMY,
config: {},
}),
}),
inject: [ConfigService],
}),
// ...
],
})
export class AppModule {}
• new StorageModule(): StorageModule
▸ createQueueServiceProvider(): Provider
<undefined
| QueueServiceContract
>
Provider
<undefined
| QueueServiceContract
>
packages/storage/src/storage.module.ts:66
▸ forRoot(options
): DynamicModule
Name | Type |
---|---|
options |
StorageModuleOptions |
DynamicModule
packages/storage/src/storage.module.ts:42
▸ forRootAsync(asyncOptions
): DynamicModule
Name | Type |
---|---|
asyncOptions |
AsyncProvider <StorageModuleOptions > |
DynamicModule