api+openapi: GET /api/ship + POST upgrade/expand/build with 400/404/409/422 mapping

This commit is contained in:
2026-09-28 23:38:11 +00:00
parent 5fe306d64d
commit fce27ff6ca
6 changed files with 354 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
import { getGameDb } from '@/lib/db/client'
import { getShipState } from '@/lib/game/ship'
// The ship's systems + cargo hold + turn; auto-initializes on first hit.
export async function GET() {
const db = await getGameDb()
return Response.json(await getShipState(db))
}