mirror of
https://github.com/joaovitoriasilva/endurain.git
synced 2026-01-11 08:47:55 -05:00
Front-end sub-routes not served from FastAPI #161
Closed
opened 2025-07-08 08:41:41 -04:00 by AtHeartEngineer
·
0 comments
No Branch/Tag Specified
master
0.16.6
gh-pages
pre-release
0.16.5
copilot/add-pr-tracking-system
copilot/fix-330
copilot/fix-321
v0.16.5
v0.16.4
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.16.0-RC2
v0.16.0-RC1
v0.16.0-Alpha5
v0.16.0-Alpha4
v0.15.9
v0.15.8
v0.15.7
v0.16.0-Alpha3
v0.16.0-Alpha2
v0.16.0-Alpha1
v0.15.6
v0.15.5
v0.15.4
v0.15.3
v0.15.2
v0.15.1
v0.15.0
v0.15.0-RC4
v0.15.0-RC3
v0.15.0-RC2
v0.15.0-RC1
v0.14.2
v0.14.1
v0.14.0
v0.14.0-RC2
v0.14.0-RC1
v0.13.4
v0.13.3
v0.13.2
v0.13.1
v0.13.0
v0.13.0-RC3
v0.13.0-RC2
v0.13.0-RC1
v0.12.7
v0.12.6
v0.12.5
v0.12.4
v0.12.3
v0.12.2
v0.12.1
v0.12.0
v0.11.4
v0.11.3
v0.11.2
v0.11.1
v0.11.0
v0.10.7
v0.10.6
v0.10.5
v0.10.4
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.2
v0.8.1
v0.8.0
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.5
v0.6.4
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.4.0
v0.3.3
v0.3.2
v0.3.1
v0.3.0
v0.2.0
v0.1.5
v0.1.4
v0.1.3
v0.1.2
v0.1.1
v0.1.0
Labels
Clear labels
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
dependencies
dependencies
dependencies
dependencies
dependencies
dependencies
dependencies
dependencies
documentation
documentation
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
good first issue
good first issue
good first issue
good first issue
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
javascript
javascript
javascript
javascript
javascript
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
onlydust-wave
python
python
python
wontfix
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
AtHeartEngineer
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github/endurain#161
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lime-red on 1/13/2025
Hi! I installed today and had some trouble with linking to Strava. I got there in the end, but it seems like I've missed a trick.
The details:
Going to
http://address/will load the front-end app, and once loaded, Vue routing works fine. However if I go directly tohttp://address/settings, FastAPI looks for/app/backend/dist/settings, does not find it, so returns a 404. This presented a problem for the strava callback, which looked for/app/backend/dist/settings/strava/callback, did not find it, and returned a 404.Perhaps I missed an obvious setup step. If so, we can stop here. However assuming I didn't, I found two things that might help. One is that I created symlinks in /app/backend/dist that match the vue routes, and if found, serve out the main index.html. Once the index.html is loaded in the browser, Vue router correctly handles the named route as we'd expect. I did this:
Once I did this, the callback was successfully processed. It would need symlinks to be created as part of the docker build.
The other is to add some fallback route in the FastAPI app.py that responds to any of the vue route names by directly serving the correct index.html. The example code is here: https://github.com/fastapi/fastapi/issues/130#issuecomment-624764879
A third option would be to use some reverse proxy rewrite rules, but since a reverse proxy is not already part of the default setup, I wouldn't seek to add it just for this.
Again, assuming this is a real issue and not just something I did wrong in my initial setup, do you have any thoughts on how you'd prefer to implement? I'm happy to raise a PR in either style.