* update to connection-details endpoint * chore: Update .env.example * chore: Update .env.example * remove fallback logic * chore: Update connection details property names
15 lines
449 B
TypeScript
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 });
|
|
}
|
|
}
|
|
}
|