backend: Rename participants.routes.ts to participant.routes.ts for consistency

This commit is contained in:
juancarmore 2025-04-12 12:37:25 +02:00
parent ef67924fbc
commit 9ccda10c6e
3 changed files with 13 additions and 14 deletions

View File

@ -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';

View File

@ -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,

View File

@ -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);