Skip to content
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

Avoid hardcoding the localhost variable in the source. #95

Open
zaddok opened this issue Dec 13, 2022 · 4 comments
Open

Avoid hardcoding the localhost variable in the source. #95

zaddok opened this issue Dec 13, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@zaddok
Copy link

zaddok commented Dec 13, 2022

The file src/App/api/index.js hardcodes a variable const apiRoot = "http://localhost:5000/";

This is less than ideal because it causes problems if people don't have a standard setup. i.e. run on their docker server that is onto n their computer, run on a vps, etc....

Can we at least document the existence of this setting in the readme, or perhaps make it a docker config setting somehow, or just remove the variable?

@zaddok zaddok added the enhancement New feature or request label Dec 13, 2022
@kudanai
Copy link

kudanai commented Jan 28, 2023

Adding some more context to this:

The backend allows setting APIPORT in docker-compose.yml which is necessary in recent versions of MacOS because port 5000 conflicts with AirPlay.

However, changing this env alone is not enough and requires modifying the hardcoded value as mentioned above.

@ZionPi
Copy link

ZionPi commented Jun 7, 2023

Yes ,if future visitors got errors like
mrs-frontend | Could not open index.js in the editor. mrs-frontend | mrs-frontend | To set up the editor integration, add something like REACT_EDITOR=atom to the .env.local file in your project folder and restart the development server. Learn more: https://goo.gl/MMTaZt
beside change ports and APIPORT value in /mimic-recording-studio/docker-compose.yml
you should also change value in /mimic-recording-studio/frontend/src/App/api/index.js,which is hardcoded.

@marshalleq
Copy link

marshalleq commented Aug 2, 2023

Thanks very much to @zaddok and @kudanai I think this may be the solution to my problem. Trying it now! It works! It works! It works! (On Mac).

Thanks very much. You're right this should be in the documentation as I would have gotten it working weeks ago when I first tried it.

@marshalleq
Copy link

I'd argue this is not an enhancement, since it blocks other functionality. I.e. docker is meant to respect a port change, but it doesn't because this value is hardcoded. Also, it's required in order to get this running on Mac. Doesn't sound like an enhancement to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants