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

How to mount on path? #161

Open
buggtb opened this issue Aug 15, 2018 · 1 comment
Open

How to mount on path? #161

buggtb opened this issue Aug 15, 2018 · 1 comment

Comments

@buggtb
Copy link

buggtb commented Aug 15, 2018

Hello, I've been handed a dashboard designed on top of this great framework. The issue I have is I need to stick it behind an apache server on a url scheme like /dashboard

When I mount it under mod_proxy like:

    ProxyPass /dashboard http://localhost:3000/
    ProxyPassReverse /dashboard http://localhost:3000/

When I go to the dashboard it starts to render but tries to find the /config endpoint at the top level instead of under /dashboard/config so the proxy fails. Is there a way in mozaik(v1) I can fix this? or do I need to contruct a rewrite scheme in apache?

@tgranqvist
Copy link

Hello. I changed the following and it seems to work in Chrome and Edge.

In ./node_modules/mozaik/src/browser/stores/ConfigStore.js, change the line

request.get('./config')

into

request.get('config')

And in ./node_modules/mozaik/src/browser/stores/ApiStore.js, replace the line defining wsUrl with

let pathname = window.document.location.pathname || '';

let wsUrl = `${proto}://${window.document.location.hostname}`;

if (pathname) {
    wsUrl = `${wsUrl}${pathname}`;
}

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