From ef55d9bb24430610b60c1b77821307cd72c08c55 Mon Sep 17 00:00:00 2001 From: zwlucas Date: Sat, 25 Jul 2026 18:23:29 -0300 Subject: feat: upload of the project Signed-off-by: zwlucas --- web/vite.config.ts | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 web/vite.config.ts (limited to 'web/vite.config.ts') diff --git a/web/vite.config.ts b/web/vite.config.ts new file mode 100644 index 0000000..980f48c --- /dev/null +++ b/web/vite.config.ts @@ -0,0 +1,33 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +export default defineConfig({ + plugins: [react()], + + resolve: { + alias: { + // Permite: import { api } from '@/lib/api' + '@': path.resolve(__dirname, './src'), + }, + }, + + server: { + port: 5173, + proxy: { + // Redireciona /api/* para o servidor Fastify em desenvolvimento + // Elimina problemas de CORS — o browser só fala com localhost:5173 + '/api': { + target: 'http://localhost:3000', + changeOrigin: true, + }, + '/health': { + target: 'http://localhost:3000', + changeOrigin: true, + }, + }, + }, +}); -- cgit v1.2.3