2023-05-09 15:20:03 +00:00
|
|
|
import { NextResponse } from "next/server";
|
2023-04-10 18:54:31 +00:00
|
|
|
|
|
|
|
import { getServerSideConfig } from "../../config/server";
|
|
|
|
|
|
|
|
const serverConfig = getServerSideConfig();
|
|
|
|
|
|
|
|
// Danger! Don not write any secret value here!
|
|
|
|
// 警告!不要在这里写入任何敏感信息!
|
|
|
|
const DANGER_CONFIG = {
|
|
|
|
needCode: serverConfig.needCode,
|
2023-05-03 15:49:33 +00:00
|
|
|
hideUserApiKey: serverConfig.hideUserApiKey,
|
2023-07-04 15:16:24 +00:00
|
|
|
disableGPT4: serverConfig.disableGPT4,
|
2023-06-25 12:20:36 +00:00
|
|
|
hideBalanceQuery: serverConfig.hideBalanceQuery,
|
2023-04-10 18:54:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
type DangerConfig = typeof DANGER_CONFIG;
|
|
|
|
}
|
|
|
|
|
2023-05-04 14:18:03 +00:00
|
|
|
async function handle() {
|
2023-05-03 15:49:33 +00:00
|
|
|
return NextResponse.json(DANGER_CONFIG);
|
2023-04-10 18:54:31 +00:00
|
|
|
}
|
2023-04-22 17:37:47 +00:00
|
|
|
|
2023-05-04 14:18:03 +00:00
|
|
|
export const GET = handle;
|
|
|
|
export const POST = handle;
|
|
|
|
|
2023-04-22 17:37:47 +00:00
|
|
|
export const runtime = "edge";
|