refactor nginx
Signed-off-by: Omar Sánchez Pizarro <omar.sanchez@pistacero.net>
This commit is contained in:
@@ -2,7 +2,7 @@ import { defineConfig } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import { fileURLToPath, URL } from 'url';
|
||||
|
||||
export default defineConfig({
|
||||
export default defineConfig(({ mode }) => ({
|
||||
plugins: [vue()],
|
||||
base: '/dashboard/',
|
||||
resolve: {
|
||||
@@ -12,7 +12,9 @@ export default defineConfig({
|
||||
},
|
||||
server: {
|
||||
port: 3000,
|
||||
proxy: {
|
||||
host: true,
|
||||
// Proxy solo para desarrollo local
|
||||
proxy: mode === 'development' ? {
|
||||
'/api': {
|
||||
target: 'http://localhost:3001',
|
||||
changeOrigin: true,
|
||||
@@ -21,7 +23,7 @@ export default defineConfig({
|
||||
target: 'ws://localhost:3001',
|
||||
ws: true,
|
||||
},
|
||||
},
|
||||
} : undefined,
|
||||
},
|
||||
});
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user