vite.config.js 451 B

12345678910111213141516171819202122
  1. import { defineConfig } from 'vite';
  2. import vue from '@vitejs/plugin-vue';
  3. export default defineConfig({
  4. plugins: [vue()],
  5. server: {
  6. host: '0.0.0.0',
  7. port: 5173,
  8. proxy: {
  9. '/api': {
  10. target: 'http://localhost:8080',
  11. changeOrigin: true,
  12. headers: { 'Connection': 'keep-alive' }
  13. },
  14. '/ws': {
  15. target: 'ws://localhost:8080',
  16. ws: true,
  17. changeOrigin: true
  18. }
  19. }
  20. }
  21. });