-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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(gatsby): Supports multiple development proxies #20369
Conversation
) | ||
.on(`error`, (err, _, response) => { | ||
if (response) { | ||
proxy.forEach(({prefix, url}) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if only an object is set in the config?
Would still behave as an array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Object would be converted to array by joi array.single()
url: Joi.string().required(), | ||
}) | ||
) | ||
.single(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be my dev preference. Having a more specific type either array
or object
gives more predictability to the code execution. I would rather release it as a breaking change.
Having only:
proxy: Joi.array()
.items(
Joi.object().keys({
prefix: Joi.string().required(),
url: Joi.string().required(),
})
),
Sorry taking long on this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There are some merge conflicts from additional fixes to proxying, this will be fine to merge once those are done.
Description
Makes development proxy config accepts either an object or array of objects.
Documentation
https://www.gatsbyjs.org/docs/api-proxy/
Related Issues
#20366