Easy way to add a proxy during dev?
Is there any easy way to add some proxying during developen? Neither
devProxy
from vinxi nor proxy
from vite seems to be supported currently through defineConfig
? Trying to get around CORS when using a hosted staging backend.8 Replies
ratty-blush•12mo ago
GitHub
Is there a way to have Rewrites or Proxy? · TanStack router · Discu...
This might be a dumb question, but I couldn't find any docs for it, so I might as well ask. My team is moving away from nextjs (pages) and moving to TSR (tanstack router with start/vinxi). One ...
xenial-blackOP•12mo ago
Looks promising, but how do I only apply this proxy during the
start
command? I can't pass an arrow function to defineConfig
, right?ratty-blush•12mo ago
so you want this to only apply during dev?
we should be able to expose dev proxy from vinxi
want to try this out yourself ?
xenial-blackOP•12mo ago
I already did a couple weeks ago – zod validation needed changes and then all hell broke lose because Zod couldn't handle the types from the proxy
xenial-blackOP•12mo ago

xenial-blackOP•12mo ago
Hope to find some time to create a draft PR, maybe someone can guide me into the right direction.
ratty-blush•12mo ago
use z.custom for this
did this help?
xenial-blackOP•11mo ago
Sorry, I just didn't yet come around looking at this. We needed an even more complex proxy setup with sub domains and therefore I've went with a custom solution for now.