Files
livekit_token/start_server.sh
2026-05-21 10:14:05 +08:00

17 lines
537 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 启动 Token Server
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR"
# 检查 .env 文件是否存在
if [ ! -f ".env" ]; then
echo "警告: 未找到 .env 文件,请确保环境变量(LIVEKIT_API_KEY, LIVEKIT_API_SECRET)已经正确配置!"
echo "参考示例cp .env.example .env"
fi
echo "正在通过 uv 启动 FastAPI 服务..."
# 使用 uv run 来运行,这样可以确保使用正确的隔离环境并自动解析依赖
uv run uvicorn server:app --host 0.0.0.0 --port 8000