Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal/file upload configurations #1587

Open
jackey8616 opened this issue Mar 13, 2024 · 3 comments
Open

Proposal/file upload configurations #1587

jackey8616 opened this issue Mar 13, 2024 · 3 comments

Comments

@jackey8616
Copy link
Collaborator

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:

  1. Stop using tsoa.json's multerOptions, we can mark it as deprecated, after keep supporting it for few versions then remove it.
  2. Define a global(for express/koa multer & hapi config) file upload config as RegisterRoutes parameter, allow users to provide it in there server.ts.
  3. There must be some needs on setting different upload destination path or file size limitation for endpoints, thus, we should introduce some kind of decorator like @UploadOptions takes more options and merge with default global configuration to provides different uploading setup for each endpoint.
@jackey8616
Copy link
Collaborator Author

@WoH any suggestion?

@github-actions github-actions bot added the Stale label Apr 19, 2024
@jackey8616 jackey8616 removed the Stale label Apr 25, 2024
Repository owner deleted a comment from github-actions bot Apr 25, 2024
@WoH WoH reopened this Apr 25, 2024
@WoH
Copy link
Collaborator

WoH commented Apr 25, 2024

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.

@jackey8616
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants