-
Notifications
You must be signed in to change notification settings - Fork 619
api server url env cleanup #4887
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
Conversation
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @MananTank and the rest of your teammates on |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4887 +/- ##
=======================================
Coverage 47.60% 47.60%
=======================================
Files 1054 1054
Lines 57164 57164
Branches 3917 3917
=======================================
Hits 27212 27212
Misses 29263 29263
Partials 689 689
*This pull request uses carry forward flags. Click here to find out more. |
size-limit report 📦
|
Your org has enabled the Graphite merge queue for merging into mainAdd the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
| process.env.NEXT_PUBLIC_DASHBOARD_UPLOAD_SERVER || | ||
| "https://storage.thirdweb.com"; | ||
|
|
||
| export const API_SERVER_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.
as long as we're clear that this is only supposed to be used in backend functions and never directly from the client this is fine.
Merge activity
|
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
This PR introduces a new constant, `API_SERVER_URL`, to centralize the API server URL configuration. It replaces instances of `process.env.NEXT_PUBLIC_THIRDWEB_API_HOST` throughout the codebase, enhancing maintainability and readability.
### Detailed summary
- Added `API_SERVER_URL` in `env.ts`.
- Replaced `process.env.NEXT_PUBLIC_THIRDWEB_API_HOST` with `API_SERVER_URL` in multiple files:
- `getAccount.ts`
- `fetchEcosystemList.ts`
- `fetchEcosystem.ts`
- `team-members.ts`
- `get-auth-token/route.ts`
- `getAPIKeys.ts`
- `ensure-login/route.ts`
- `server-proxy/api/[...paths].tsx`
- `team.ts`
- `projects.ts`
- `create-ticket.action.ts`
- `auth-actions.ts`
- `utils.ts`
- Updated fetch requests to use `API_SERVER_URL` for consistent API endpoint access.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
a58d9ae to
025c581
Compare

Problem solved
Short description of the bug fixed or feature added
PR-Codex overview
This PR focuses on refactoring the API server URL usage across multiple files in the
dashboardapplication. It introduces a new constant,API_SERVER_URL, to centralize the management of the API endpoint, replacing direct references to the environment variable.Detailed summary
API_SERVER_URLconstant inenv.ts.API_SERVER_URLin:getAccount.tsfetchEcosystemList.tsfetchEcosystem.tsteam-members.tsget-auth-token/route.tsgetAPIKeys.tsensure-login/route.tsserver-proxy/api/[...paths].tsxteam.tsprojects.tscreate-ticket.action.tsauth-actions.tsutils.tsAPI_SERVER_URLfor consistency and maintainability.