mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-11 17:29:37 +02:00
Added proxy configuration to route API requests from frontend (port 5173) to backend (port 2222). This resolves the issue where the frontend couldn't fetch notes because it was trying to access the API on the wrong port. Changes: - Changed Vite dev server port from 2222 to 5173 - Added proxy rules for /api and /uploads endpoints - Both proxies target http://localhost:2222 (backend) This completes the fix for notes not displaying. The frontend can now properly communicate with the backend through the proxy.
32 lines
669 B
TypeScript
32 lines
669 B
TypeScript
import { defineConfig } from "vite";
|
|
import dyadComponentTagger from "@dyad-sh/react-vite-component-tagger";
|
|
import react from "@vitejs/plugin-react-swc";
|
|
import path from "path";
|
|
|
|
export default defineConfig(() => ({
|
|
server: {
|
|
host: "::",
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:2222',
|
|
changeOrigin: true,
|
|
},
|
|
'/uploads': {
|
|
target: 'http://localhost:2222',
|
|
changeOrigin: true,
|
|
}
|
|
}
|
|
},
|
|
build: {
|
|
outDir: "dist",
|
|
emptyOutDir: true,
|
|
},
|
|
plugins: [dyadComponentTagger(), react()],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
}));
|