meet/app/api/url/route.ts
Jonas Schell f2f4ada03d
Refactor app use connection details endpoint (#302)
* update to connection-details endpoint

* chore: Update .env.example

* chore: Update .env.example

* remove fallback logic

* chore: Update connection details property names
2024-08-23 09:48:49 +02:00

15 lines
449 B
TypeScript

import { getLiveKitURL } from '@/lib/server-utils';
import { NextRequest, NextResponse } from 'next/server';
export async function GET(req: NextRequest) {
try {
const region = req.nextUrl.searchParams.get('region');
const livekitUrl = getLiveKitURL(region);
return NextResponse.json({ url: livekitUrl });
} catch (error) {
if (error instanceof Error) {
return new NextResponse(error.message, { status: 500 });
}
}
}