Lazuli, now with openapi!

This commit is contained in:
Eclypsed
2024-02-18 00:01:54 -05:00
parent 85a17dcd89
commit 1608e03b97
14 changed files with 177 additions and 291 deletions

View File

@@ -0,0 +1,12 @@
import type { RequestHandler } from '@sveltejs/kit'
import { Connections } from '$lib/server/users'
export const GET: RequestHandler = async ({ url }) => {
const ids = url.searchParams.get('ids')?.replace(/\s/g, '').split(',')
if (!ids) return new Response('Missing ids query parameter', { status: 400 })
const connections: Connection[] = []
for (const connectionId of ids) connections.push(Connections.getConnection(connectionId))
return Response.json({ connections })
}