diff --git a/.gitignore b/.gitignore index c937861..a33930f 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,6 @@ instance/ # Virtual environment venv/ -env/ .venv/ # Byte-compiled / cache diff --git a/deploy.sh b/deploy.sh index 4119958..67c5ffe 100644 --- a/deploy.sh +++ b/deploy.sh @@ -306,7 +306,7 @@ echo "$(timestamp) Backend → http://localhost:5000" echo " Log: $BACKEND_LOG" echo " PID: $(cat backend.pid 2>/dev/null || echo 'N/A')" echo "" -echo "$(timestamp) Frontend → http://localhost:3000" +echo "$(timestamp) Frontend → http://localhost:5173" echo " Log: $FRONTEND_LOG" echo " PID: $(cat frontend.pid 2>/dev/null || echo 'N/A')" echo "=========================================" diff --git a/frontend/src/context/AuthContext.tsx b/frontend/src/context/AuthContext.tsx index 00265ac..46c7a43 100644 --- a/frontend/src/context/AuthContext.tsx +++ b/frontend/src/context/AuthContext.tsx @@ -11,7 +11,7 @@ interface AuthContextType { const AuthContext = createContext(undefined); -const API_BASE = 'http://127.0.0.1:5000'; +const API_BASE = import .meta.env.VITE_API_BASE // Helper: decode a JWT payload (no signature check — used only to read exp) function decodeJwtPayload(token: string | null) { diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx index 87df47a..3e5520b 100644 --- a/frontend/src/pages/Dashboard.tsx +++ b/frontend/src/pages/Dashboard.tsx @@ -23,7 +23,7 @@ interface OrderItem { status: string; } -const API_BASE = 'http://127.0.0.1:5000'; +const API_BASE = import .meta.env.VITE_API_BASE export default function Dashboard() { const { logout } = useAuth(); diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 147380a..0254775 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,10 +1,15 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; - + // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], optimizeDeps: { exclude: ['lucide-react'], }, + server: { + port: 1573, + strictPort: true, + host: true + } });