Lazuli, now with openapi!
This commit is contained in:
12
src/routes/api/connections/+server.ts
Normal file
12
src/routes/api/connections/+server.ts
Normal 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 })
|
||||
}
|
||||
Reference in New Issue
Block a user