#How does URL rewrite work in Tanstack query?

1 messages · Page 1 of 1 (latest)

pastel egret
#

I have updated my app.config.ts file with nitro config to rewrite / to /home

app.config.ts

    routeRules: {
      "/": {
        proxy: {
          to: "/home"
        }
      }
    }

But because / route does not exist, whenever I visit / i get a flash of /home before getting the 404 view

velvet jackal
#

what's your definition of "rewrite" ?

pastel egret
velvet jackal
#

we don't support rewriting routes yet in that way

#

in your config, tanstack router is not aware that this rewrite is happening and thus cannot take it into account

#

we will add some API to do this in router in the future

pastel egret
#

Ok, noted. Will keep an eye out for the update