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.
28 lines
743 B
TypeScript
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);
|
|
}
|
|
});
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|