Skip to content

Commit

Permalink
test server db stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Likqez committed Oct 4, 2024
1 parent d0daeda commit d0fe4fb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server/api/calc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {serverSupabaseClient} from '#supabase/server'

export default defineEventHandler(async (event) => {
const client = await serverSupabaseClient(event)
const {data} = await client.from('calculations').select('*')
await client.from('calculations').insert({operand: '+', left: 10, right: 5, result: 10+5})

return {data: data}
})

0 comments on commit d0fe4fb

Please sign in to comment.