nxtgauge-admin-solid/vite.config.ts
Ashwin Kumar 31b3a04a81 fix: add API proxy to backend localhost:9100
Added Vite dev server proxy configuration to forward /api requests
to the Rust backend gateway at localhost:9100.

This fixes 401 errors by allowing the admin panel to properly
communicate with the backend API.
2026-04-10 02:29:53 +02:00

28 lines
743 B
TypeScript

/// <reference types="vitest/config" />
import { defineConfig } from "@solidjs/start/config";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
ssr: false,
vite: {
plugins: [tailwindcss()],
server: {
proxy: {
"/api": {
target: "http://localhost:9100",
changeOrigin: true,
secure: false,
ws: true,
configureProxy: (proxy) => {
proxy.on("proxyReq", (proxyReq, req) => {
// Forward cookies and auth headers
const cookie = req.headers.cookie;
if (cookie) {
proxyReq.setHeader("Cookie", cookie);
}
});
},
},
},
},
},
});