backend: Implement meeting routes

This commit is contained in:
juancarmore 2025-04-12 12:59:19 +02:00
parent 79afa0cd03
commit 9fb281626d
4 changed files with 27 additions and 2 deletions

View File

@ -69,8 +69,7 @@ export const refreshParticipantToken = async (req: Request, res: Response) => {
export const deleteParticipant = async (req: Request, res: Response) => {
const logger = container.get(LoggerService);
const participantService = container.get(ParticipantService);
const { participantName } = req.params;
const roomId: string = req.query.roomId as string;
const { roomId, participantName } = req.params;
try {
await participantService.deleteParticipant(participantName, roomId);

View File

@ -4,3 +4,4 @@ export * from './room.routes.js';
export * from './auth.routes.js';
export * from './livekit.routes.js';
export * from './participant.routes.js';
export * from './meeting.routes.js';

View File

@ -0,0 +1,23 @@
import { Router } from 'express';
import bodyParser from 'body-parser';
import * as meetingCtrl from '../controllers/meeting.controller.js';
import * as participantCtrl from '../controllers/participant.controller.js';
import { withModeratorPermissions, participantTokenValidator, withAuth } from '../middlewares/index.js';
export const internalMeetingRouter = Router();
internalMeetingRouter.use(bodyParser.urlencoded({ extended: true }));
internalMeetingRouter.use(bodyParser.json());
// Internal Meetings Routes
internalMeetingRouter.delete(
':roomId',
withAuth(participantTokenValidator),
withModeratorPermissions,
meetingCtrl.endMeeting
);
internalMeetingRouter.delete(
':roomId/participants/:participantName',
withAuth(participantTokenValidator),
withModeratorPermissions,
participantCtrl.deleteParticipant
);

View File

@ -12,6 +12,7 @@ import {
} from './utils/path-utils.js';
import {
authRouter,
internalMeetingRouter,
internalParticipantRouter,
internalRecordingRouter,
internalRoomRouter,
@ -56,6 +57,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}/meetings`, internalMeetingRouter);
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);