Move LiveKit Webhook route to app level

This commit is contained in:
cruizba 2026-02-02 19:58:38 +01:00
parent b0c7dcbc9a
commit 4e634dac54

View File

@ -100,8 +100,6 @@ const createApp = () => {
appRouter.use('/health', (_req: Request, res: Response) => res.status(200).send('OK'));
// LiveKit Webhook route
appRouter.use('/livekit/webhook', livekitWebhookRouter);
// Serve OpenVidu Meet webcomponent bundle file
appRouter.get('/v1/openvidu-meet.js', (_req: Request, res: Response) => res.sendFile(webcomponentBundlePath));
// Serve OpenVidu Meet index.html file for all non-API routes (with dynamic base path injection)
@ -113,6 +111,10 @@ const createApp = () => {
res.status(404).json({ error: 'Path Not Found', message: 'API path not implemented' })
);
// LiveKit Webhook route - mounted directly on app (not under base path)
// This allows webhooks to always be received at /livekit/webhook regardless of base path configuration
app.use('/livekit/webhook', livekitWebhookRouter);
// Mount all routes under the configured base path
app.use(basePath, appRouter);