mirror of
https://github.com/ArthurDanjou/spanish-learner.git
synced 2026-01-21 07:21:42 +01:00
Working
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
export default defineEventHandler(() => {
|
||||
return { hello: 'API' }
|
||||
})
|
||||
4
server/api/verb.get.ts
Normal file
4
server/api/verb.get.ts
Normal 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
4
server/api/word.get.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export default defineEventHandler(async () => {
|
||||
const words = await useDB().query.words.findMany()
|
||||
return words[Math.floor(Math.random() * words.length)]
|
||||
})
|
||||
Reference in New Issue
Block a user