This commit is contained in:
2024-07-30 21:00:50 +02:00
parent 5092005816
commit 78f572d099
13 changed files with 1204 additions and 2808 deletions

View File

@@ -1,3 +0,0 @@
export default defineEventHandler(() => {
return { hello: 'API' }
})

4
server/api/verb.get.ts Normal file
View File

@@ -0,0 +1,4 @@
export default defineEventHandler(async () => {
const verbs = await useDB().query.verbs.findMany()
return verbs[Math.floor(Math.random() * verbs.length)]
})

4
server/api/word.get.ts Normal file
View File

@@ -0,0 +1,4 @@
export default defineEventHandler(async () => {
const words = await useDB().query.words.findMany()
return words[Math.floor(Math.random() * words.length)]
})