chatgpt-ui
开源地址:https://github.com/WongSaang/chatgpt-ui
本地调试
新建 .env
增加 changeOrigin: true
参数,否则会出现跨域等问题
import { createProxyMiddleware } from 'http-proxy-middleware'
export default defineEventHandler(async (event) => {
await new Promise((resolve, reject) => {
createProxyMiddleware({
target: process.env.SERVER_DOMAIN,
pathFilter: '/api',
changeOrigin: true
})(event.node.req, event.node.res, (err) => {
if (err)
reject(err)
else
resolve(true)
})
})
})