💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
node作为中间层并不需要处理所有api请求,api转发代码如下: ` if (pathname.includes("/api") || pathData.includes(pathname)) { // 转发htp请求 console.log(pathname, req.method); try { if (/GET/i.test(req.method)) { req.pipe(request.get(URL + req.url)).pipe(res); } else if (/POST|PUT/i.test(req.method)) { req.pipe(request.post(URL + req.url, { form: req.body })).pipe(res); } } catch (error) { console.log(error); res.end(`{err:${error}}`); } }