You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			32 lines
		
	
	
		
			859 B
		
	
	
	
		
			TypeScript
		
	
		
		
			
		
	
	
			32 lines
		
	
	
		
			859 B
		
	
	
	
		
			TypeScript
		
	
| 
											9 months ago
										 | import { NextResponse } from "next/server"; | ||
|  | 
 | ||
|  | import { getServerSideConfig } from "../../config/server"; | ||
|  | 
 | ||
|  | const serverConfig = getServerSideConfig(); | ||
|  | 
 | ||
|  | // Danger! Do not hard code any secret value here!
 | ||
|  | // 警告!不要在这里写入任何敏感信息!
 | ||
|  | const DANGER_CONFIG = { | ||
|  |   needCode: serverConfig.needCode, | ||
|  |   hideUserApiKey: serverConfig.hideUserApiKey, | ||
|  |   disableGPT4: serverConfig.disableGPT4, | ||
|  |   hideBalanceQuery: serverConfig.hideBalanceQuery, | ||
|  |   disableFastLink: serverConfig.disableFastLink, | ||
|  |   customModels: serverConfig.customModels, | ||
|  |   defaultModel: serverConfig.defaultModel, | ||
|  |   visionModels: serverConfig.visionModels, | ||
|  | }; | ||
|  | 
 | ||
|  | declare global { | ||
|  |   type DangerConfig = typeof DANGER_CONFIG; | ||
|  | } | ||
|  | 
 | ||
|  | async function handle() { | ||
|  |   return NextResponse.json(DANGER_CONFIG); | ||
|  | } | ||
|  | 
 | ||
|  | export const GET = handle; | ||
|  | export const POST = handle; | ||
|  | 
 | ||
|  | export const runtime = "edge"; |