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

Config route #166

Open
menreiki opened this issue Oct 30, 2018 · 4 comments
Open

Config route #166

menreiki opened this issue Oct 30, 2018 · 4 comments

Comments

@menreiki
Copy link

I'm deploying Mozaik dashboard in the subdirectory(e.g. localhost:8001/x/y) inside another react app (e.g. localhost:8001). All apps are running inside their own docker containers. I had the issue not being able to fetch config. And here is the way I solved it. Is there some other proper way to do it?

mozaik/packages/ui/src/actions/configurationActions.js
-        return fetch('/config')
+        const baseUrl = process.env.REACT_APP_BASE_URL || ''
+        return fetch(baseUrl + '/config')

where I add REACT_APP_BASE_URL=localhost:8001/x/y in Dockerfile of the dashboard app.

I do not have much exp with react, so any advice or lead is appreciated.

@brianespinosa
Copy link

@delikatessa are you using v1 or v2 of Mozaik?

@menreiki
Copy link
Author

menreiki commented Nov 7, 2018

@delikatessa are you using v1 or v2 of Mozaik?

v2

@brianespinosa
Copy link

I think what you did is probably fine. My guess though is you might be able to come up with a more dynamic solution using Node's path that does not require defining the location as an environment variable. But if that works for you, then I think you're good.

@menreiki
Copy link
Author

menreiki commented Nov 8, 2018

@brianespinosa thanks for the feedback! I will look into it. The thing is I don't want to fork the project just for this change.

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

No branches or pull requests

2 participants