Dev setup: Proxying multiple Vite apps - Stack Overflow

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

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744503623a4577575.html

相关推荐

  • Dev setup: Proxying multiple Vite apps - Stack Overflow

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

    1天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信