Fix Windows IPv6 issue: use 127.0.0.1 instead of localhost in Vite proxy
On Windows, 'localhost' can resolve to IPv6 ::1 instead of IPv4 127.0.0.1, causing ECONNREFUSED when the Vite dev proxy tries to reach the Express server. Using explicit 127.0.0.1 avoids this. Fixes #12
This commit is contained in:
+4
-4
@@ -10,19 +10,19 @@ export default defineConfig(({ mode }) => {
|
||||
host: '0.0.0.0',
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:3001',
|
||||
target: 'http://127.0.0.1:3001',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/audio': {
|
||||
target: 'http://localhost:3001',
|
||||
target: 'http://127.0.0.1:3001',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/editor': {
|
||||
target: 'http://localhost:3001',
|
||||
target: 'http://127.0.0.1:3001',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/blog': {
|
||||
target: 'http://localhost:3001',
|
||||
target: 'http://127.0.0.1:3001',
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user