diff --git a/server/api/calc.ts b/server/api/calc.ts new file mode 100644 index 0000000..fc8c9a5 --- /dev/null +++ b/server/api/calc.ts @@ -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} +})