Compatible with NestJs?
MorenoMdz opened this issue · 2 comments
Is this package compatible with NestJs somehow?
Trying something like errors out with multer_firebase_storage_1.FirebaseStorage
@Controller('storage')
export class StorageController {
constructor(private readonly configService: ConfigService) {}
@Post('upload')
@UseInterceptors(
FileInterceptor('file', {
storage: FirebaseStorage({
bucketName: '',
credentials: {
clientEmail: '',
privateKey: '',
projectId: '',
},
}),
}),
)
uploadFile(@UploadedFile() file: Express.Multer.File) {
return {
url: file.path,
name: file.originalname,
}
}
}
Now if I try to use our current instance of FB we get a different error saying Bucket Name is required
@Controller('storage')
export class StorageController {
constructor(private readonly configService: ConfigService) {}
@Post('upload')
@UseInterceptors(
FileInterceptor('file', {
storage: FirebaseStorage({}, firebaseAdmin),
}),
)
uploadFile(@UploadedFile() file: Express.Multer.File) {
return {
url: file.path,
name: file.originalname,
}
}
}
It was supposed to be, I'm not aware on how nest works in general, but this is just a plugin for multer, which should return the expected interface.
If you fill out the bucket name, does it work?
It was supposed to be, I'm not aware on how nest works in general, but this is just a plugin for multer, which should return the expected interface.
If you fill out the bucket name, does it work?
I was not able to get it working, but also ended up going to a different route and used a signedUrl for our upload system. Will close this one, thanks!