-
Notifications
You must be signed in to change notification settings - Fork 135
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
make more convinient for developing in the remote machine #1132
Conversation
- this can bring a little more convenience when developing in a remote machine
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Codecov Report
@@ Coverage Diff @@
## master #1132 +/- ##
==========================================
- Coverage 29.42% 28.24% -1.19%
==========================================
Files 210 227 +17
Lines 11877 12841 +964
Branches 647 647
==========================================
+ Hits 3495 3627 +132
- Misses 8243 9064 +821
- Partials 139 150 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Nice trick! |
When a user develops TiDB dashboard in a remote machine and accesses the frontend page in the local, he will get the following error by accessing
http://{remote_addr}:3001/dashboard
in the local browser:Because the frontend can't access the backend API by
http://127.0.0.0:12333/dashboard/api
.Solutions:
Forward local port 12333 to the remote, for example:
ssh -L 12333:locahost:12333 remote_addr
.Run TiDB dashboard backend by
bin/tidb-dashboard --host 0.0.0.0
and setREACT_APP_DASHBOARD_API_URL=http://{remote_addr}:12333
in the.env
fileRun TiDB dashboard backend by
bin/tidb-dashboard --host 0.0.0.0
and usehttp://${window.location.hostname}:12333/dashboard
instead ofhttp://127.0.0.01:12333/dashboard
as API addr prefix.This PR implements solution 3, and I think this would bring a little more convenience for the developers to develop in a remote machine.