opencollective-frontend
opencollective-frontend copied to clipboard
Set up http-proxy in pages/api/[...proxy]
- Adding a proxy through
http-proxyinpages/api/[...proxy].ts- Will retain the API proxy functionality from the custom server, enabling to pass along headers (such as the root redirect cookie)
- Since it is using a catch all route
[...proxy]we can remove all other routes that are set up to proxy things to the API here
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| opencollective-frontend | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 22, 2024 1:46pm |
| opencollective-styleguide | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 22, 2024 1:46pm |
This stack of pull requests is managed by Graphite. Learn more about stacking.
Join @gustavlrsn and the rest of your teammates on
Graphite
Todo:
- [x] Remove
pages/api/connected-accounts/*routes (should be handled by the catch-all proxy)
@Betree yep, predefined routes should keep precedence over catch all routes:
Predefined API routes take precedence over dynamic API routes, and dynamic API routes over catch all API routes.
https://nextjs.org/docs/pages/building-your-application/routing/api-routes#caveats