mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 14:22:28 +08:00
- Add DAILY_REQUEST_LIMIT env var support in config API - Track request count in localStorage (resets daily) - Show friendly quota limit toast with self-host/sponsor links - Apply limit to send, regenerate, and edit message actions
14 lines
396 B
TypeScript
14 lines
396 B
TypeScript
import { NextResponse } from "next/server"
|
|
|
|
export async function GET() {
|
|
const accessCodes =
|
|
process.env.ACCESS_CODE_LIST?.split(",")
|
|
.map((code) => code.trim())
|
|
.filter(Boolean) || []
|
|
|
|
return NextResponse.json({
|
|
accessCodeRequired: accessCodes.length > 0,
|
|
dailyRequestLimit: parseInt(process.env.DAILY_REQUEST_LIMIT || "0", 10),
|
|
})
|
|
}
|