Replies: 1 comment 1 reply
-
Huh, this might be the answer, https://tanstack.com/router/latest/docs/framework/react/guide/history-types#hash-routing, I just haven't found it on my own. Subject to confirmation. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm wondering if it is possible to use TanStack router in a way that doesn't require server-side URL rewrite of the "fake" path produced by the SPA.
Consider the following scenario:
/
, which in fact is/index.html
./foo/bar
, which is then pushed into the browser's URL/foo/bar
indstead of/
or/index.html
Unless the server is configured to serve
/index.html
for all requests, or at least all 404 requests, the reload will fail.In other words, the browser is inventing routes that server doesn't hold, and the server then must pretend the routes exist in order for the app to work.
I find it difficult to escape the fact that this problem would go away if I was able to configure TanStack router to hold the entire path in a query string:
/index.html?path=/foo/bar
.We're not trying to pretend this is a server-side app with actual directory structure, and so inventing a non-existent path name serves no purpose in our case.
I am finding it particularly painful when hosting multiple versions of our SPA in "subdirectory" of our S3 bucket and serving the contents of the S3 bucket via CloudFront. Each directory name is derived from git branch, and the objective is to deploy each branch into a single directory for UAT. All of this is fairly irrelevant to TanStack router, but I thought it might be useful to explain the context of my question.
So the question is, is there an option for TanStack router to use a query string in the URL rather than the URL itself?
Beta Was this translation helpful? Give feedback.
All reactions