25 lines
590 B
TypeScript
25 lines
590 B
TypeScript
import { sveltekit } from '@sveltejs/kit/vite';
|
|
import { defineConfig } from 'vite';
|
|
|
|
export default defineConfig({
|
|
plugins: [sveltekit()],
|
|
server: {
|
|
host: 'localhost',
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://10.77.48.43:3000',
|
|
changeOrigin: true,
|
|
configure: (proxy, _options) => {
|
|
proxy.on('proxyReq', (proxyReq, req, _res) => {
|
|
if (req.headers.cookie) {
|
|
proxyReq.setHeader('Cookie', req.headers.cookie);
|
|
}
|
|
console.log('[Backend Proxy]', req.method, req.url, '→ Cookies:', !!req.headers.cookie);
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|