cloudflare config

This commit is contained in:
Jonas Schell 2024-08-22 11:43:48 +02:00
parent 7978271f0f
commit 15e862533d
8 changed files with 23 additions and 1 deletions

View File

@ -1,6 +1,8 @@
import { EgressClient, EncodedFileOutput, S3Upload } from 'livekit-server-sdk';
import { NextResponse } from 'next/server';
export const runtime = 'edge';
export async function GET(req: Request) {
try {
const url = new URL(req.url);

View File

@ -1,6 +1,8 @@
import { EgressClient } from 'livekit-server-sdk';
import { NextResponse } from 'next/server';
export const runtime = 'edge';
export async function GET(req: Request) {
try {
const url = new URL(req.url);

View File

@ -3,6 +3,8 @@ import type { AccessTokenOptions, VideoGrant } from 'livekit-server-sdk';
import { TokenResult } from '@/lib/types';
import { NextResponse } from 'next/server';
export const runtime = 'edge';
const apiKey = process.env.LIVEKIT_API_KEY;
const apiSecret = process.env.LIVEKIT_API_SECRET;

View File

@ -1,6 +1,8 @@
import { getLiveKitURL } from '../../../lib/server-utils';
import { NextResponse } from 'next/server';
export const runtime = 'edge';
export async function GET(req: Request) {
try {
const url = new URL(req.url);

View File

@ -2,6 +2,8 @@ import { videoCodecs } from 'livekit-client';
import { VideoConferenceClientImpl } from './VideoConferenceClientImpl';
import { isVideoCodec } from '@/lib/types';
export const runtime = 'edge';
export default function CustomRoomConnection(props: {
searchParams: {
liveKitUrl?: string;

View File

@ -5,6 +5,8 @@ import React, { Suspense, useState } from 'react';
import { encodePassphrase, generateRoomId, randomString } from '@/lib/client-utils';
import styles from '../styles/Home.module.css';
export const runtime = 'edge';
function Tabs(props: React.PropsWithChildren<{}>) {
const searchParams = useSearchParams();
const tabIndex = searchParams?.get('tab') === 'custom' ? 1 : 0;

View File

@ -27,6 +27,8 @@ import { SettingsMenu } from '@/lib/SettingsMenu';
import { RecordingIndicator } from '@/lib/RecordingIndicator';
import { isVideoCodec } from '@/lib/types';
export const runtime = 'edge';
export default function Page({ params }: { params: { roomName: string } }) {
const router = useRouter();
const roomName = params.roomName;

View File

@ -1,3 +1,5 @@
import { setupDevPlatform } from '@cloudflare/next-on-pages/next-dev';
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
@ -13,4 +15,10 @@ const nextConfig = {
},
};
module.exports = nextConfig;
// This allows you to access Cloudflare bindings in local development.
// Ignore this, you probably don't need it.
if (process.env.NODE_ENV === 'development') {
await setupDevPlatform();
}
export default nextConfig;