diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index c550667..70a4cbd 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -1,6 +1,6 @@ import type { NetObject, ServiceInfo } from '../types'; -const AGENT_BASE = 'http://127.0.0.1:8001'; +const AGENT_BASE = '/api'; export async function fetchObjects(): Promise { return [ diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts new file mode 100644 index 0000000..22b8102 --- /dev/null +++ b/frontend/vite.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; + +export default defineConfig({ + plugins: [react()], + server: { + host: '0.0.0.0', + port: 5173, + proxy: { + '/api': { + target: 'http://127.0.0.1:8001', + changeOrigin: true, + }, + }, + }, +});