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

[ui] Remove default value for base API URL #40

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

evamillan
Copy link
Collaborator

This PR sets the default API base URL to http://localhost:8000 only in development mode and / in every other case. By default yarn serve runs in development mode and yarn build runs in production mode.

The base URL can be changed with the VITE_API_ENDPOINT env variable.

Sets the default API base URL to 'http://localhost:8000' only
in development mode and '/' in every other case. The base
URL can be changed with the 'VITE_API_ENDPOINT' env variable.

Signed-off-by: Eva Millán <[email protected]>
Copy link
Member

@sduenas sduenas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work when we have --dev option for the server?

@evamillan
Copy link
Collaborator Author

How does this work when we have --dev option for the server?

There is no difference, if you create the UI static files using yarn build, the API base URL will be / in any case. It only points to localhost:8000 when the UI is served with yarn serve or if it is built with the --mode development option specifically.

Copy link
Member

@sduenas sduenas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sduenas sduenas merged commit 5323462 into chaoss:main Mar 4, 2025
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants