-
Notifications
You must be signed in to change notification settings - Fork 1
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: organize proxy routes #13
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…ath" This reverts commit 246c27a. graphql-request doesn't seem able to handle redirects natively: https://stackoverflow.com/questions/78015439/follow-redirects-setting-for-aws-appsync#comment137542218_78015439 Thus, reverting the redirect change
anxolin
approved these changes
May 2, 2024
anxolin
added a commit
that referenced
this pull request
May 7, 2024
* feat: coingecko proxy (#10) * feat: add coingeckoProxy * chore: add fastify/caching dependency * feat: add request caching * fix: only cache successfull responses from proxy origin * chore: improve logging * feat: set our own cache-control header * chore: delete set-cookie header * chore: rename local header from cache-hit to x-proxy-cache and leave it in the reply * Revert "chore: rename local header from cache-hit to x-proxy-cache and leave it in the reply" This reverts commit 71ecd72. * fix: prevent content-length header mismatch errors * fix: do not fwd accept-encoding header, as I'm not able to deal with encoded response * chore: attempt at caching only after response is sent * chore: try a different way to decorate * Revert "chore: try a different way to decorate" This reverts commit 31672a6. * Revert "chore: attempt at caching only after response is sent" This reverts commit b2dd0eb. * feat: coingecko proxy without server side caching (#11) * feat: remove server side caching * chore: remove fastify-caching * chore: undici config still required * fix: type on cdn-cache-control value * feat: add coingecko api key (#12) * feat: add coingecko api key to proxy requests * fix: remove `simple` prefix as it's part of coingecko's path * chore: temporarily change to pro-api since the key is set to "pro" * chore: add COINGECKO_PROXY_UPSTREAM as optional env var * feat: organize proxy routes (#13) * refactor: move coingeckoProxy to proxies/coingecko * refactor: move proxy to proxies/tokens and keep proxy for awhile * chore: add permanent redirect rather than re-exporting same path * Revert "chore: add permanent redirect rather than re-exporting same path" This reverts commit 246c27a. graphql-request doesn't seem able to handle redirects natively: https://stackoverflow.com/questions/78015439/follow-redirects-setting-for-aws-appsync#comment137542218_78015439 Thus, reverting the redirect change * fix: build and run --------- Co-authored-by: Anxo Rodriguez <anxolin@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
As suggested on #10 (review)
Move path
coingeckoProxy
toproxies/coingecko
And to match the pattern, also moved
proxy
toproxies/tokens
Kept the old
proxy
to not break existing consumers. To be removed at a later date.I did add a permanent redirect, but graphql-request is not capable of following it.
It would essentially break existing consumers.
Testing
coingeckoProxy
withhttps://cow-web-services-git-feat-organize-proxy-routes-cowswap.vercel.app/proxies/coingecko
proxy
withhttps://cow-web-services-git-feat-organize-proxy-routes-cowswap.vercel.app/proxies/tokens
proxy
withhttps://cow-web-services-git-feat-organize-proxy-routes-cowswap.vercel.app/proxy