mirror of
https://github.com/2234839/web-font.git
synced 2026-05-17 19:38:13 +08:00
- 新增通用 LruCache 类,支持按条目数/字节容量两种淘汰策略 - 字体裁剪结果 LRU 内存缓存(默认 10MB,X-Cache 响应头标识命中) - 新增 GET /api/stats 运行时统计接口 - 前端统计面板(10s 轮询,页面不可见时暂停) - API handler 拆分到 routes/ 目录,提取 shared.ts 共享模块 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
15 lines
384 B
TypeScript
15 lines
384 B
TypeScript
import { jsonResponse } from "../shared";
|
|
import { enableTempUpload, adminApiKey } from "../config";
|
|
|
|
/** GET /api/config — 返回公开配置 */
|
|
export async function handleGetConfig(req: Request, res: Response) {
|
|
return {
|
|
req,
|
|
res: jsonResponse({
|
|
enableTempUpload,
|
|
adminUploadEnabled: !!adminApiKey,
|
|
supportedOutTypes: ["woff2", "ttf"],
|
|
}),
|
|
};
|
|
}
|