diff options
| author | zwlucas <lucas.fariamo08@gmail.com> | 2026-07-25 21:23:29 +0000 |
|---|---|---|
| committer | zwlucas <lucas.fariamo08@gmail.com> | 2026-07-25 21:23:29 +0000 |
| commit | ef55d9bb24430610b60c1b77821307cd72c08c55 (patch) | |
| tree | e6935a810b34370b0a4c821e55f6397aac50c832 /web/vite.config.ts | |
| download | helpdesk-master.tar.gz helpdesk-master.zip | |
Signed-off-by: zwlucas <lucas.fariamo08@gmail.com>
Diffstat (limited to 'web/vite.config.ts')
| -rw-r--r-- | web/vite.config.ts | 33 |
1 files changed, 33 insertions, 0 deletions
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, + }, + }, + }, +}); |