Open jackey8616 opened 4 months ago
@WoH any suggestion?
Sorry, missed this so far. Btw, you can tag it as help wanted or pending feedback to avoid the bot.
Is it enough to provide this once for the entire app? I am worried the next follow up would be multer config for down to per Endpoint level.
Sorry, missed this so far. Btw, you can tag it as help wanted or pending feedback to avoid the bot.
Is it enough to provide this once for the entire app? I am worried the next follow up would be multer config for down to per Endpoint level.
I think the global options we provides in RegisterRouter parameter could cover all.
Hi @jackey8616,
As proposed in this pull request, you can provide your custom multer to RegisterRoutes
, and tsoa will use it for file upload management in express
and koa
templates. Providing a multer instance is optional; by default, tsoa uses the default multer instance with the default configuration (or the configuration provided in tsoa.json
).
Currently in express/koa we have multer, hapi itself can handle file upload.
I've notice that we provides multerOptions in tsoa.json for preset a global multer instance. But such option is not event fit for hapi users.
When the #1483 gives the idea of custom instance of multer, I think its time to make something more 'general' for all users.
Here is my proposal:
RegisterRoutes
parameter, allow users to provide it in there server.ts.@UploadOptions
takes more options and merge with default global configuration to provides different uploading setup for each endpoint.