mirror of
https://github.com/beilunyang/moemail.git
synced 2026-06-09 09:29:38 +08:00
18 lines
546 B
TypeScript
18 lines
546 B
TypeScript
import { getRequestContext } from "@cloudflare/next-on-pages"
|
|
import { NextResponse } from "next/server"
|
|
|
|
export const runtime = "edge"
|
|
|
|
export async function GET() {
|
|
try {
|
|
const domainString = await getRequestContext().env.SITE_CONFIG.get("EMAIL_DOMAINS")
|
|
|
|
return NextResponse.json({ domains: domainString ? domainString.split(',') : ["moemail.app"] })
|
|
} catch (error) {
|
|
console.error('Failed to fetch domains:', error)
|
|
return NextResponse.json(
|
|
{ error: "获取域名列表失败" },
|
|
{ status: 500 }
|
|
)
|
|
}
|
|
}
|