api+openapi: GET /api/tech + POST /api/research with 400/404/409/422 mapping

This commit is contained in:
2026-09-29 00:30:10 +00:00
parent 8818f0928d
commit 7b0227cde9
4 changed files with 160 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
import { getGameDb } from '@/lib/db/client'
import { getTechState } from '@/lib/game/research'
// The full tech tree with per-save state (RESEARCHED / AVAILABLE / LOCKED + missing prereqs). Auto-initializes on first hit.
export async function GET() {
const db = await getGameDb()
return Response.json(await getTechState(db))
}