- Add GameRequestSchema and derived types to packages/shared - Add SupportedLanguageCode, SupportedPos, DifficultyLevel type exports - Add getGameTerms() model to packages/db with pos/language/difficulty/limit filters - Add prepareGameQuestions() service skeleton in apps/api - Add createGame controller with Zod safeParse validation - Wire POST /api/v1/game/start route - Add scripts/gametest/test-game.ts for manual end-to-end testing
18 lines
407 B
TypeScript
18 lines
407 B
TypeScript
async function main() {
|
|
const response = await fetch("http://localhost:3000/api/v1/game/start", {
|
|
method: "POST",
|
|
headers: { "Content-Type": "application/json" },
|
|
body: JSON.stringify({
|
|
source_language: "en",
|
|
target_language: "it",
|
|
pos: "noun",
|
|
difficulty: "easy",
|
|
rounds: "3",
|
|
}),
|
|
});
|
|
|
|
const data = await response.json();
|
|
console.log(data);
|
|
}
|
|
|
|
main();
|