cd58797f4c
Hermes Agent Web 管理面板,支持对话交互和定时任务管理。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
40 lines
946 B
TypeScript
40 lines
946 B
TypeScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import type { ProxyOptions } from 'vite'
|
|
import { resolve } from 'path'
|
|
|
|
function createProxyConfig(): ProxyOptions {
|
|
return {
|
|
target: 'http://127.0.0.1:8642',
|
|
changeOrigin: true,
|
|
configure: (proxy) => {
|
|
proxy.on('proxyReq', (proxyReq) => {
|
|
proxyReq.removeHeader('origin')
|
|
proxyReq.removeHeader('referer')
|
|
})
|
|
// Disable response buffering for SSE streaming
|
|
proxy.on('proxyRes', (proxyRes) => {
|
|
proxyRes.headers['cache-control'] = 'no-cache'
|
|
proxyRes.headers['x-accel-buffering'] = 'no'
|
|
})
|
|
},
|
|
}
|
|
}
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, 'src'),
|
|
},
|
|
},
|
|
server: {
|
|
compress: false,
|
|
proxy: {
|
|
'/api': createProxyConfig(),
|
|
'/v1': createProxyConfig(),
|
|
'/health': createProxyConfig(),
|
|
},
|
|
},
|
|
})
|