13 lines
456 B
TypeScript
13 lines
456 B
TypeScript
import { defineConfig, type ProxyOptions } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
const proxy: ProxyOptions = {
|
|
target: 'http://127.0.0.1:8080',
|
|
changeOrigin: true,
|
|
configure(server) {
|
|
server.on('proxyReq', request => {
|
|
if (request.getHeader('origin')) request.setHeader('origin', 'http://127.0.0.1:8080')
|
|
})
|
|
},
|
|
}
|
|
export default defineConfig({ plugins: [react()], server: { proxy: { '/admin': proxy, '/v1': proxy } } })
|