chore: air hot-reload + configurable backend port for dev proxy

This commit is contained in:
Pi Agent
2026-09-02 16:13:36 +00:00
parent 887d45a771
commit 681adda585
4 changed files with 37 additions and 6 deletions
+5 -1
View File
@@ -2,12 +2,16 @@ import { defineConfig } from "vite";
import preact from "@preact/preset-vite";
import tailwindcss from "@tailwindcss/vite";
// Бэк для дев-прокси выбирается портом, не правкой кода:
// BACKEND_PORT=8081 pnpm dev -> прокси на вторую (рабочую/дев) копию.
const apiTarget = `http://localhost:${process.env.BACKEND_PORT ?? 8080}`;
export default defineConfig({
plugins: [preact(), tailwindcss()],
server: {
proxy: {
// Connect RPC calls in dev go straight to the Go server.
"/homelab.v1.HomelabService": "http://localhost:8080",
"/homelab.v1.HomelabService": apiTarget,
},
},
});