ARCH-2b: add frontend (Vite) as Aspire resource with LAN wiring

- AppHost: AddViteApp(frontend) via Aspire.Hosting.JavaScript 13.4.2,
  WithReference(webapi)+WaitFor, inject VITE_API_BASE_URL=http://<lan-ip>:5179
  at launch (computed from the active physical adapter, follows DHCP)
- Pin proxyless ports: webapi http=5179 (matches SPA default), vite=5173,
  both bind 0.0.0.0 for LAN reachability
- vite.config: server.host=true so the dev server is LAN-visible

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-05 23:57:31 +02:00
parent 0237f5de5e
commit e9f88b7889
3 changed files with 70 additions and 2 deletions

View File

@@ -4,4 +4,10 @@ import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
server: {
// Bind on all interfaces so the dev server is reachable from other devices
// on the LAN (phone/laptop) when launched via .NET Aspire. Aspire assigns
// the port; this only widens the host from localhost to 0.0.0.0.
host: true,
},
})