Remodeled database and api to prepare for move
This commit is contained in:
10
server/api/worlds/index.get.ts
Normal file
10
server/api/worlds/index.get.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { serverSupabaseClient } from "#supabase/server";
|
||||
import type { World } from "~/models/World";
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const client = await serverSupabaseClient(event)
|
||||
|
||||
return client.from('worlds')
|
||||
.select(`id, name, description, color`)
|
||||
.returns<World[]>()
|
||||
})
|
||||
Reference in New Issue
Block a user