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

frontend: ability to run under a different base path #25

Closed
RobertRosca opened this issue Aug 29, 2024 · 0 comments · Fixed by #28
Closed

frontend: ability to run under a different base path #25

RobertRosca opened this issue Aug 29, 2024 · 0 comments · Fixed by #28
Assignees
Labels
enhancement New feature or request

Comments

@RobertRosca
Copy link
Member

A requirement for #24 is being able to have the frontend work even when it is configured to run on a different base path, e.g. /feat/foo instead of /.

Played around with this a bit and got it kind of working, but not all the way. Changes I think are required are:

  1. Some configuration to set the base (e.g. env var)
  2. Vite should read this and set the correct base path - https://vitejs.dev/guide/build#public-base-path
  3. React router should be aware of it as well - https://reactrouter.com/en/main/routers/create-browser-router#optsbasename
  4. Calls in js should also either be aware of it or always use relative addresses (e.g. stuff like history.navigate("/home") and fetch("/oauth/logout", should reference the base path or be relative where possible) - looks like this can be handled by vite by using ${import.meta.env.BASE_URL}/... for urls.
@RobertRosca RobertRosca added the enhancement New feature or request label Aug 29, 2024
@CammilleCC CammilleCC self-assigned this Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants