- Add Next.js app structure with base configs, linting, and formatting - Implement LiveKit Meet page, types, and utility functions - Add Docker, Compose, and deployment scripts for backend and token server - Provide E2E and smoke test scaffolding with Puppeteer and Playwright helpers - Include CSS modules and global styles for UI - Add postMessage and studio integration utilities - Update package.json with dependencies and scripts for development and testing
13 lines
457 B
TypeScript
13 lines
457 B
TypeScript
export function getLiveKitURL(projectUrl: string, region: string | null): string {
|
|
const url = new URL(projectUrl);
|
|
if (region && url.hostname.includes('livekit.cloud')) {
|
|
let [projectId, ...hostParts] = url.hostname.split('.');
|
|
if (hostParts[0] !== 'staging') {
|
|
hostParts = ['production', ...hostParts];
|
|
}
|
|
const regionURL = [projectId, region, ...hostParts].join('.');
|
|
url.hostname = regionURL;
|
|
}
|
|
return url.toString();
|
|
}
|