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: 2 comments 8 replies

Comment options

You must be logged in to vote
7 replies
@schiller-manuel
Comment options

@rijk
Comment options

@ssijak
Comment options

@carderne
Comment options

@Emilios1995
Comment options

Answer selected by andrewmurraydavid
Comment options

You must be logged in to vote
1 reply
@CanRau
Comment options

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