最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Dev setup: Proxying multiple Vite apps - Stack Overflow

programmeradmin1浏览0评论

I'm working on a dev setup for a monorepo. It contains multiple apps powered by Vite:

  • An Astro app (the landing page)
  • A React Router app (a web app)

In production, their build outputs are merged and requests are managed by a reverse proxy. I'd like to mirror that in my development environment (astro dev and vite serve respectively).

When a browser visits a URL, the path (some URLs always serve the web app, some always serve the landing page) and the cookies (signed in users are served the landing page on the / root directory) decide which app handles the request.

Any proxy before the two apps cannot make a purely path- and header-based decision because paths like localhost/@vite/client and localhost/@fs are the same between the two apps.

How can I set up a development proxy that routes requests, including to Vite's internal routes, to the right app? I was looking for an option to give these paths a user-facing prefix but have not found anything.

发布评论

评论列表(0)

  1. 暂无评论