openvidu-recording-basic-node: minor refactoring
This commit is contained in:
parent
48e1fb79f7
commit
5343660dfa
@ -14,24 +14,12 @@ import { S3Service } from "./s3.service.js";
|
||||
|
||||
// Configuration
|
||||
const SERVER_PORT = process.env.SERVER_PORT || 6080;
|
||||
const LIVEKIT_URL = process.env.LIVEKIT_URL || "http://localhost:7880";
|
||||
const LIVEKIT_API_KEY = process.env.LIVEKIT_API_KEY || "devkey";
|
||||
const LIVEKIT_API_SECRET = process.env.LIVEKIT_API_SECRET || "secret";
|
||||
const LIVEKIT_URL = process.env.LIVEKIT_URL || "http://localhost:7880";
|
||||
const RECORDINGS_PATH = process.env.RECORDINGS_PATH ?? "recordings/";
|
||||
const RECORDING_FILE_PORTION_SIZE = 5 * 1024 * 1024; // 5MB
|
||||
|
||||
// Initialize services
|
||||
const egressClient = new EgressClient(
|
||||
LIVEKIT_URL,
|
||||
LIVEKIT_API_KEY,
|
||||
LIVEKIT_API_SECRET
|
||||
);
|
||||
const webhookReceiver = new WebhookReceiver(
|
||||
LIVEKIT_API_KEY,
|
||||
LIVEKIT_API_SECRET
|
||||
);
|
||||
const s3Service = new S3Service();
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(cors());
|
||||
@ -43,6 +31,17 @@ const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
app.use(express.static(path.join(__dirname, "../public")));
|
||||
|
||||
const egressClient = new EgressClient(
|
||||
LIVEKIT_URL,
|
||||
LIVEKIT_API_KEY,
|
||||
LIVEKIT_API_SECRET
|
||||
);
|
||||
const s3Service = new S3Service();
|
||||
const webhookReceiver = new WebhookReceiver(
|
||||
LIVEKIT_API_KEY,
|
||||
LIVEKIT_API_SECRET
|
||||
);
|
||||
|
||||
// Generate access tokens for participants to join a room
|
||||
app.post("/token", async (req, res) => {
|
||||
const roomName = req.body.roomName;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user