Files
mars-ui/vite.config.js
2025-03-25 21:20:25 +08:00

42 lines
1.2 KiB
JavaScript

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import fs from 'fs'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
// https:{
// key: fs.readFileSync(path.resolve(__dirname, './certs/localhost+5-key.pem')),
// cert: fs.readFileSync(path.resolve(__dirname, './certs/localhost+5.pem')),
// },
host: '0.0.0.0',
port: 3000,
open: false,
cors:true,
proxy:{
'/create-api':{
// target:'https://api.agora.io/cn/api/conversational-ai-agent/v2',
target: 'https://api.sd-rtn.com/cn/api/conversational-ai-agent/v2',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/create-api/, ''),
headers: {
'Authorization': 'Basic OGRkM2EzOGUxNTJjNGU1NDlmNWMwOTg0YmRhYzc1ZTE6ZWY1MTI2ZTRmMWFlNGE5MWE0MzVhN2Q0ZDc0YzNlYjg=',
}
},
// '/llm-api':{
// target:'https://vip.apiyi.com/v1/chat/completions',
// changeOrigin: true,
// rewrite: (path) => path.replace(/^\/llm-api/, ''),
// }
}
}
})