Download src/app/api/coach/difficulty/route.ts from NAP1320/RotNot: direct link, hf CLI and curl.
- Browser
- Download file 771 Bytes
-
https://huggingface.co/spaces/NAP1320/RotNot/resolve/main/src/app/api/coach/difficulty/route.ts
- Command line
-
hf download hf://spaces/NAP1320/RotNot/src/app/api/coach/difficulty/route.ts
-
curl -L -o route.ts https://huggingface.co/spaces/NAP1320/RotNot/resolve/main/src/app/api/coach/difficulty/route.ts
771 Bytes
| import { NextResponse } from "next/server"; | |
| import { withApiError } from "@/lib/api-error"; | |
| import { getPerformanceSummary } from "@/lib/performance"; | |
| import { getRecommendedSettings } from "@/lib/difficulty"; | |
| /** | |
| * GET /api/coach/difficulty | |
| * | |
| * Returns per-category difficulty recommendations based on the current | |
| * performance summary for user 1. | |
| * | |
| * Response shape: | |
| * { | |
| * recommendations: { | |
| * [category]: { difficulty, nextSkill, adjustmentReason, hasHistory } | |
| * }, | |
| * updatedAt: string | |
| * } | |
| * | |
| * Part 2 of the Active Coach roadmap (Issue #6). | |
| */ | |
| export const GET = withApiError(async () => { | |
| const summary = await getPerformanceSummary(1); | |
| const result = getRecommendedSettings(summary); | |
| return NextResponse.json(result); | |
| }); | |