From 5cec61d336c33cf27267652340434e708b2dc089 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 27 Nov 2025 20:37:55 +0000 Subject: [PATCH] fix: configure Vite proxy to connect frontend to backend 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. --- vite.config.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/vite.config.ts b/vite.config.ts index ce46bfd..9b885de 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,7 +6,17 @@ import path from "path"; export default defineConfig(() => ({ server: { host: "::", - port: 2222, + port: 5173, + proxy: { + '/api': { + target: 'http://localhost:2222', + changeOrigin: true, + }, + '/uploads': { + target: 'http://localhost:2222', + changeOrigin: true, + } + } }, build: { outDir: "dist",