feat: support https_proxy for standalone mode

This commit is contained in:
wener
2023-03-31 23:41:18 +08:00
parent 2ae62d9c0e
commit 20738d9deb
8 changed files with 88 additions and 13 deletions

View File

@@ -1,6 +1,7 @@
import { createParser } from "eventsource-parser";
import { NextRequest } from "next/server";
import { requestOpenai } from "../common";
import { PageConfig } from "next/types";
async function createStream(req: NextRequest) {
const encoder = new TextEncoder();
@@ -56,6 +57,6 @@ export async function POST(req: NextRequest) {
}
}
export const config = {
runtime: "edge",
export const config: PageConfig = {
runtime: process.env.STANDALONE ? "nodejs" : "edge",
};