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