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

feat: add upload functionality in the middleware #7323

Merged
merged 4 commits into from
Nov 22, 2024

Conversation

bartoszherba
Copy link
Collaborator

@bartoszherba bartoszherba commented Nov 21, 2024

Summary

The issue involves enhancing the middleware express app by allowing the addition of multiple body parsers. Currently, only the JSON body parser is available, which limits functionality for developers needing to implement file uploads.

Context

The middleware express app is currently configured to use only a JSON body parser. This restriction poses challenges for developers who require different body parsers for specific functionalities, such as file uploads.

@bartoszherba bartoszherba requested a review from a team as a code owner November 21, 2024 11:57
Copy link

changeset-bot bot commented Nov 21, 2024

🦋 Changeset detected

Latest commit: cb75088

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@vue-storefront/middleware Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@bartoszherba bartoszherba requested review from sethidden, WojtekTheWebDev, a team and jagoral and removed request for a team and sethidden November 21, 2024 11:59
* Configuration options for handling file uploads.
* @see FileUploadOptions
*/
fileUpload?: FileUploadOptions;
Copy link
Contributor

@jagoral jagoral Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it could be great if we achieved an option to set the config based on the request

Suggested change
fileUpload?: FileUploadOptions;
fileUpload?: FileUploadOptions | (req: Request) => FileUploadOptions;

I believe user may create multiple endpoints for file upload, and some of them may differ for instance in allowedMimeTypes or maximum number of files

@bartoszherba bartoszherba force-pushed the feat/add-file-upload-handling branch from 998eacc to 4f3dced Compare November 22, 2024 07:16
@bartoszherba bartoszherba force-pushed the feat/add-file-upload-handling branch from 4f3dced to cb75088 Compare November 22, 2024 08:00
Copy link

sonarcloud bot commented Nov 22, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@bartoszherba bartoszherba merged commit f02f7cf into main Nov 22, 2024
2 checks passed
@bartoszherba bartoszherba deleted the feat/add-file-upload-handling branch November 22, 2024 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants