Skip to content

Is there a way to have Rewrites or Proxy? #2399

Discussion options

You must be logged in to vote

as of v1.58.7, we have the following:

TanStack Start now exposes the routeRules config option from nitro: https://nitro.unjs.io/guide/routing#route-rules

example:

import { defineConfig } from '@tanstack/start/config'

export default defineConfig({
  server: {
    routeRules: {
      "/proxy/example": { proxy: { to: "https://example.com"} },
    }
  },
})

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@andrewmurraydavid
Comment options

@rijk
Comment options

@schiller-manuel
Comment options

@rijk
Comment options

@ssijak
Comment options

Answer selected by andrewmurraydavid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants