Closed jagoral closed 7 months ago
Latest commit: 46e77765796df4d56d9d6fc535e72da131b54213
The changes in this PR will be included in the next version bump.
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
๐ Linked issue
โ Type of change
๐ Description
createServer
which allows to customize thecors
,cookieParser
, andbodyParser
middlewaresContext: The change is related to the hacky cors config customization which we've got atm in templates. Currently, the middleware app is run mostly on port 4000, because Storefront app occupies port 3000 (default port for Next.js), so I could change the
origin
to accept alsolocalhost:4000
, however there are also multistores which are run locally and other cases, when the current cors config is enough. The workaround which we do in the templates looks as followsI propose to instead by default allow cors for all origins, and pass an option to configure it when calling
createServer
.I've added also an option to pass config for
cookieParser
, andbodyParser
, but I'm open to exclude it from this PR, because it extends our API layer.๐ Checklist