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

Default REST path should take current app and not /EntityBrowser #10

Open
eduard93 opened this issue Jul 25, 2018 · 11 comments
Open

Default REST path should take current app and not /EntityBrowser #10

eduard93 opened this issue Jul 25, 2018 · 11 comments

Comments

@eduard93
Copy link
Contributor

Currently web app goes to /EntityBrowser/api.... It should take current URL and determine correct app automatically.

@eduard93
Copy link
Contributor Author

eduard93 commented Jul 25, 2018

Is it determined here?

@nikitaeverywhere
Copy link
Member

Yep. What is the case? Did you rename EntityBrowser?

@eduard93
Copy link
Contributor Author

What is the case? Did you rename EntityBrowser?

Yes. Well, I added another one. I need EntityBrowser in two namespaces.

@eduard93
Copy link
Contributor Author

eduard93 commented Jul 25, 2018

I'm planning to replace hardcoded EntityBrowser with window.location.pathname.replace(/\//g, '')

@nikitaeverywhere
Copy link
Member

nikitaeverywhere commented Jul 25, 2018

Ah okay, you can simply change this in settings (hopefully. But I think EntityBrowser shares localStorage on the same domain...).
Adding a new feature to iKnowEntityBrowser which will allow to change the namespace would be great.

Note that pathname could also include /index, use regex that replaces everything after the second slash.

@eduard93
Copy link
Contributor Author

eduard93 commented Jul 25, 2018

Okay, I've modified locally to window.location.pathname.split("/")[1] and it works except settings page shows incorrect app. But requests go to the correct one.

image

@nikitaeverywhere
Copy link
Member

It should be ${ getOption("webAppName") || window.location.pathname.split("/")[1] || "EntityBrowser" }, right?

@eduard93
Copy link
Contributor Author

Removed getOption("webAppName") as that way two apps wouldn't work on the same server I think

@nikitaeverywhere
Copy link
Member

Please keep it - it is used to connect to remote servers. You can set it to "" for your case to work.

@nikitaeverywhere
Copy link
Member

Good. I believe you can do PR with getOption("webAppName") || window.location.pathname.split("/")[1] || "EntityBrowser"

@nikitaeverywhere
Copy link
Member

nikitaeverywhere commented Jul 25, 2018

However, this should work from the beginning if you set "" value here. Then, change readme as well. I think adding a correct placeholder to the input would also be great.

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