-
-
Notifications
You must be signed in to change notification settings - Fork 442
Open
opencollective/opencollective-frontend
#11727Open
Enhancement
Copy link
Labels
frontendtechnical-debtDeprecated code to migrate and other necessary refactorsDeprecated code to migrate and other necessary refactors
Description
There's a practice in frontend to forward API traffic from /api/* to the API endpoint. We envisioned expanding it at some point as it would play nicely with authentication cookies/authenticated requests: #8315.
However, at this stage, this redirect is causing too many issues for little gains:
- Since Vercel charges for the execution time, we'll be billed for 10 seconds of frontend execution if the API takes 10 seconds to reply. Whatever we do, proxying means that we're using resources on the frontend server for all API queries, which does not seem right.
- This architecture is making private data traverse a service level (the frontend's backend) that arguably shouldn't be responsible for handling this data.
- Since we haven't implemented a generic proxy, it's causing many issues down the road of missing parameters, missing endpoints...etc
Proposed solution
- In dev/staging frontend, use a full path (
https://staging.opencollective.com/api/connected-accounts/...) rather than relative URLs - In production, Cloudflare will be handling the reverse proxy mechanism. (current behavior)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
frontendtechnical-debtDeprecated code to migrate and other necessary refactorsDeprecated code to migrate and other necessary refactors