dmitriy-nz / nestjs-form-data

NestJS middleware for handling multipart/form-data, which is primarily used for uploading files.
https://www.npmjs.com/package/nestjs-form-data
MIT License
118 stars 23 forks source link

Add support for async register #2

Closed Tomas2D closed 3 years ago

Tomas2D commented 3 years ago

Hey, firstly I want to thank you for this library. It is exactly what I was missing.

I propose to add support for async config to be able to create options asynchronously.

NestjsFormDataModule.registerAsync({
  useFactory: async () => {
    const config = await getConfig();

    ...

    return config;
  },
}),

Thanks.

dmitriy-nz commented 3 years ago

@Tomas2D Hey! Thanks for the good feedback. I added support for asynchronous configuration in version 1.4, new version is already available. https://github.com/dmitriy-nz/nestjs-form-data#async-configuration