Skip to content

fix(ui): Move routes to /app to avoid conflict with API endpoints#8978

Merged
mudler merged 1 commit intomudler:masterfrom
richiejp:fix/move-react-ui-browse
Mar 13, 2026
Merged

fix(ui): Move routes to /app to avoid conflict with API endpoints#8978
mudler merged 1 commit intomudler:masterfrom
richiejp:fix/move-react-ui-browse

Conversation

@richiejp
Copy link
Collaborator

@richiejp richiejp commented Mar 12, 2026

Description

The /backends enpoint is part of the well established API and returns JSON. It conflicts with the react UI's routes.

When the SPA router is being used then the user can navigate to it as expected, but if they navigate directly to it with the address bar or refresh they get JSON.

Previously the UI was at /browse, which is also where user bookmarks will be directed as well as proxy configurations in theory.

UPDATE: Moved routes to /app instead per review comment and /browse redirects to /app. Also added regression tests for exempted endpoints because they got out of sync with the routes.

Notes for Reviewers

It's possible to pay attention to the HTTP header for what content the client will accept and return HTML or JSON. However it makes the route registration more complicated.
Also in theory, even if HTML is requested, the client may not want a react SPA, they may just want simple HTML.
Finally if a user really wants the UI to be available at / this can be achieved with a proxy server and allowing the API url to be configured.

Signed commits

  • Yes, I signed my commits.

@netlify
Copy link

netlify bot commented Mar 12, 2026

Deploy Preview for localai ready!

Name Link
🔨 Latest commit 58d2a17
🔍 Latest deploy log https://app.netlify.com/projects/localai/deploys/69b438685ed3b4000886705b
😎 Deploy Preview https://deploy-preview-8978--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@richiejp richiejp force-pushed the fix/move-react-ui-browse branch 2 times, most recently from 2194008 to 807f5cd Compare March 13, 2026 10:15
@richiejp richiejp changed the title fix(ui): Move routes back to browse to avoid conflict with API endpoints fix(ui): Move routes to /app to avoid conflict with API endpoints Mar 13, 2026
@richiejp richiejp force-pushed the fix/move-react-ui-browse branch 2 times, most recently from 5ece92f to 2942d00 Compare March 13, 2026 11:24
Also test for regressions in HTTP GET API key exempted endpoints because
this list can get out of sync with the UI routes.

Also fix support for proxying on a different prefix both server and
client side.

Signed-off-by: Richard Palethorpe <io@richiejp.com>
@richiejp richiejp force-pushed the fix/move-react-ui-browse branch from 2942d00 to 58d2a17 Compare March 13, 2026 16:16
@mudler mudler merged commit ed2c6da into mudler:master Mar 13, 2026
34 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