1.5 KiB
1.5 KiB
LiveKit Meet Server
A simple backend server to provide connection details for the LiveKit Meet demo app.
Features
/api/connection-details
endpoint for room connection details- CORS support for frontend requests
- Static file serving for the built WASM app
- Health check endpoint
Usage
- Build the frontend first:
cd .. && trunk build
- Run the server:
cd server && cargo run
- Access the app at: http://localhost:8083
API Endpoints
GET /api/connection-details?roomName=<room>&participantName=<name>
- Get connection detailsGET /health
- Health check
Production Setup
For production use, you'll need to:
- Replace the mock token generation with proper LiveKit JWT tokens
- Add your actual LiveKit server URL
- Add proper authentication and validation
- Use environment variables for configuration
Example with real LiveKit tokens:
use livekit_api::access_token::{AccessToken, VideoGrant};
fn generate_token(room_name: &str, participant_name: &str) -> String {
let api_key = std::env::var("LIVEKIT_API_KEY").unwrap();
let api_secret = std::env::var("LIVEKIT_API_SECRET").unwrap();
let grant = VideoGrant {
room_join: true,
room: room_name.to_string(),
..Default::default()
};
let token = AccessToken::new(&api_key, &api_secret)
.with_identity(participant_name)
.with_video_grant(grant)
.to_jwt()
.unwrap();
token
}