-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
fix(vite-plugin-nitro): use proxy for API requests instead of custom middleware #1378
Conversation
✅ Deploy Preview for analog-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-ng-app ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-app ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-blog ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Thanks a lot @brandonroberts for this fix! Really appreciated! |
I was checking what was happening with the headers that weren't being set in prod using Vercel for a couple of days. Initially I thought it was a problem with h3 in Vercel, but in the end, I figured out the problem could be in the nitro vite plugin but I hadn't a chance to keep digging. I really appreciate this fix @brandonroberts, thanks 😄 |
PR Checklist
Closes #
What is the new behavior?
Introduces the
useAPIMiddleware
flag for theplatform
package.API routes are built under
/api
during development, and/
in the production build, and requests made to/api
routes are configured using custom internal middleware. This flag disables the custom internal middleware and usesrouteRules
to proxy the request instead, which allows the API routes to properly preserve cookies and headers with direct requests and redirects.routeRules
configuration is merged with the internal configuration if provided.Does this PR introduce a breaking change?
Other information
[optional] What gif best describes this PR or how it makes you feel?