ee9f56dfbd
- Add Koa2 BFF layer for API proxy, file upload, session management - Auto-check and enable api_server in ~/.hermes/config.yaml on startup - Integrate sessions with Hermes CLI (list, get, delete) - Add Logs page with level filtering, log file selection, and search - Add CLI commands: start/stop/restart/status for daemon management - Unify package.json for frontend and server dependencies - Default port changed to 8648 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
41 lines
1002 B
TypeScript
41 lines
1002 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:8648',
|
|
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: {
|
|
proxy: {
|
|
'/api': createProxyConfig(),
|
|
'/v1': createProxyConfig(),
|
|
'/health': createProxyConfig(),
|
|
'/upload': createProxyConfig(),
|
|
'/webhook': createProxyConfig(),
|
|
},
|
|
},
|
|
})
|