mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 08:07:34 +08:00
feat: #1640 support free gpt endpoint
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { NextRequest } from "next/server";
|
||||
|
||||
const OPENAI_URL = "api.openai.com";
|
||||
export const OPENAI_URL = "api.openai.com";
|
||||
const DEFAULT_PROTOCOL = "https";
|
||||
const PROTOCOL = process.env.PROTOCOL ?? DEFAULT_PROTOCOL;
|
||||
const BASE_URL = process.env.BASE_URL ?? OPENAI_URL;
|
||||
@@ -45,8 +45,8 @@ export async function requestOpenai(req: NextRequest) {
|
||||
signal: controller.signal,
|
||||
});
|
||||
} catch (err: unknown) {
|
||||
if (err instanceof Error && err.name === 'AbortError') {
|
||||
console.log('Fetch aborted');
|
||||
if (err instanceof Error && err.name === "AbortError") {
|
||||
console.log("Fetch aborted");
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
|
Reference in New Issue
Block a user