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:
fspecii
2026-02-05 23:12:38 +02:00
parent 2f2b1e2f92
commit dade566647
+4 -4
View File
@@ -10,19 +10,19 @@ export default defineConfig(({ mode }) => {
host: '0.0.0.0', host: '0.0.0.0',
proxy: { proxy: {
'/api': { '/api': {
target: 'http://localhost:3001', target: 'http://127.0.0.1:3001',
changeOrigin: true, changeOrigin: true,
}, },
'/audio': { '/audio': {
target: 'http://localhost:3001', target: 'http://127.0.0.1:3001',
changeOrigin: true, changeOrigin: true,
}, },
'/editor': { '/editor': {
target: 'http://localhost:3001', target: 'http://127.0.0.1:3001',
changeOrigin: true, changeOrigin: true,
}, },
'/blog': { '/blog': {
target: 'http://localhost:3001', target: 'http://127.0.0.1:3001',
changeOrigin: true, changeOrigin: true,
}, },
}, },