diff --git a/backend/src/routes/index.ts b/backend/src/routes/index.ts index 035e7ce..7afb625 100644 --- a/backend/src/routes/index.ts +++ b/backend/src/routes/index.ts @@ -3,3 +3,4 @@ export * from './global-preferences.routes.js'; export * from './room.routes.js'; export * from './auth.routes.js'; export * from './livekit.routes.js'; +export * from './participant.routes.js'; diff --git a/backend/src/routes/participants.routes.ts b/backend/src/routes/participant.routes.ts similarity index 76% rename from backend/src/routes/participants.routes.ts rename to backend/src/routes/participant.routes.ts index fb797de..c338dee 100644 --- a/backend/src/routes/participants.routes.ts +++ b/backend/src/routes/participant.routes.ts @@ -8,24 +8,24 @@ import { import { configureTokenAuth, withModeratorPermissions } from '../middlewares/participant.middleware.js'; import { participantTokenValidator, withAuth } from '../middlewares/auth.middleware.js'; -export const internalParticipantsRouter = Router(); -internalParticipantsRouter.use(bodyParser.urlencoded({ extended: true })); -internalParticipantsRouter.use(bodyParser.json()); +export const internalParticipantRouter = Router(); +internalParticipantRouter.use(bodyParser.urlencoded({ extended: true })); +internalParticipantRouter.use(bodyParser.json()); // Internal Participant Routes -internalParticipantsRouter.post( +internalParticipantRouter.post( '/token', validateParticipantTokenRequest, configureTokenAuth, participantCtrl.generateParticipantToken ); -internalParticipantsRouter.post( +internalParticipantRouter.post( '/token/refresh', validateParticipantTokenRequest, configureTokenAuth, participantCtrl.refreshParticipantToken ); -internalParticipantsRouter.delete( +internalParticipantRouter.delete( '/:participantName', withAuth(participantTokenValidator), validateParticipantDeletionRequest, diff --git a/backend/src/server.ts b/backend/src/server.ts index 3cd9d47..cd41a4c 100644 --- a/backend/src/server.ts +++ b/backend/src/server.ts @@ -2,11 +2,7 @@ import express, { Request, Response, Express } from 'express'; import cors from 'cors'; import chalk from 'chalk'; import { registerDependencies, initializeEagerServices } from './config/dependency-injector.config.js'; -import { - SERVER_PORT, - SERVER_CORS_ORIGIN, - logEnvVars, -} from './environment.js'; +import { SERVER_PORT, SERVER_CORS_ORIGIN, logEnvVars } from './environment.js'; import { publicApiHtmlFilePath, indexHtmlPath, @@ -16,6 +12,7 @@ import { } from './utils/path-utils.js'; import { authRouter, + internalParticipantRouter, internalRecordingRouter, internalRoomRouter, livekitWebhookRouter, @@ -23,7 +20,6 @@ import { recordingRouter, roomRouter } from './routes/index.js'; -import { internalParticipantsRouter } from './routes/participants.routes.js'; import cookieParser from 'cookie-parser'; import { jsonSyntaxErrorHandler } from './middlewares/content-type.middleware.js'; import INTERNAL_CONFIG from './config/internal-config.js'; @@ -48,7 +44,9 @@ const createApp = () => { app.use(cookieParser()); // Public API routes - app.use(`${INTERNAL_CONFIG.API_BASE_PATH_V1}/docs`, (_req: Request, res: Response) => res.sendFile(publicApiHtmlFilePath)); + app.use(`${INTERNAL_CONFIG.API_BASE_PATH_V1}/docs`, (_req: Request, res: Response) => + res.sendFile(publicApiHtmlFilePath) + ); app.use(`${INTERNAL_CONFIG.API_BASE_PATH_V1}/rooms`, /*mediaTypeValidatorMiddleware,*/ roomRouter); app.use(`${INTERNAL_CONFIG.API_BASE_PATH_V1}/recordings`, /*mediaTypeValidatorMiddleware,*/ recordingRouter); @@ -58,7 +56,7 @@ const createApp = () => { ); app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/auth`, authRouter); app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/rooms`, internalRoomRouter); - app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/participants`, internalParticipantsRouter); + app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/participants`, internalParticipantRouter); app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/recordings`, internalRecordingRouter); app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/preferences`, preferencesRouter);