MycroftAI/mimic-recording-studio

Avoid hardcoding the `localhost` variable in the source.

zaddok opened this issue · 4 comments

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?

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.

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.

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.

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.