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

Add base URL option #35

Closed
tony2guo opened this issue Sep 1, 2023 · 5 comments
Closed

Add base URL option #35

tony2guo opened this issue Sep 1, 2023 · 5 comments

Comments

@tony2guo
Copy link
Contributor

tony2guo commented Sep 1, 2023

Hi, thanks for the great work!
I would like to use Vizanti under some subfolder like this: http://<host_ip>/vizanti
Possible adding a base URL option or use relative URLs?

@MoffKalast
Copy link
Owner

MoffKalast commented Sep 1, 2023

Hmm well if by host_ip you mean without the :port part that's a bit of a problem. ROS really doesn't want anything to do with root and linux won't let anything but root host on port 80, so it's a bit of a standoff. One option that I've used in the past is to set up a root hosted redirect server like nginx on port 80 separately, that then routes to 5000. Or running server.py with sudo python3.

The server expects some specific paths which would need to be adjusted on both ends to support the extra /vizanti, but in theory it would be doable.

@tony2guo
Copy link
Contributor Author

tony2guo commented Sep 4, 2023

I am using Traefik as a reverse proxy to route subfolder /vizanti to port 5000 but found some errors due to some URLs is not relative URLs. I'll try to fix this and create a PR.

@tony2guo
Copy link
Contributor Author

tony2guo commented Sep 4, 2023

To add a base URL, I've tried blueprints but can not get it to work.
I've also tried to hardcode the base URL: noetic-devel...tony2guo:vizanti:base-url
It works, but there should be some better ways. I'm not familiar with Flask, so I'm not sure how this should be done.

@MoffKalast
Copy link
Owner

MoffKalast commented Sep 5, 2023

The current setup uses jinja templating, which seems to have some kind of url_for function that would be added to returned templates. Not sure if it's the correct URL though.

@tony2guo
Copy link
Contributor Author

tony2guo commented Sep 7, 2023

Thanks for the info. I'll try url_for().

@tony2guo tony2guo mentioned this issue Sep 15, 2023
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