| 12345678910111213141516171819202122 |
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
-
- export default defineConfig({
- plugins: [vue()],
- server: {
- port: 3000,
- host: 'localhost', // 明确指定host
- proxy: {
- '/api': {
- target: 'http://localhost:8080',
- changeOrigin: true,
- secure: false,
- configure: (proxy, options) => {
- proxy.on('proxyReq', (proxyReq, req, res) => {
- console.log('代理请求:', req.method, req.url)
- })
- }
- }
- }
- }
- })
|