feat: replace hardcoded usage limits with dynamic env variables (#180)

- About pages now read DAILY_REQUEST_LIMIT, DAILY_TOKEN_LIMIT, TPM_LIMIT from env
- Removed unused /app/api/config/ route
- Numbers formatted as Xk (e.g., 30k, 10k)
This commit is contained in:
Dayuan Jiang
2025-12-09 09:57:09 +09:00
committed by GitHub
parent f6cfcab45a
commit 914e914423
4 changed files with 42 additions and 24 deletions

View File

@@ -1,15 +0,0 @@
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),
dailyTokenLimit: parseInt(process.env.DAILY_TOKEN_LIMIT || "0", 10),
tpmLimit: parseInt(process.env.TPM_LIMIT || "0", 10),
})
}