backend: Implement meeting routes
This commit is contained in:
parent
79afa0cd03
commit
9fb281626d
@ -69,8 +69,7 @@ export const refreshParticipantToken = async (req: Request, res: Response) => {
|
|||||||
export const deleteParticipant = async (req: Request, res: Response) => {
|
export const deleteParticipant = async (req: Request, res: Response) => {
|
||||||
const logger = container.get(LoggerService);
|
const logger = container.get(LoggerService);
|
||||||
const participantService = container.get(ParticipantService);
|
const participantService = container.get(ParticipantService);
|
||||||
const { participantName } = req.params;
|
const { roomId, participantName } = req.params;
|
||||||
const roomId: string = req.query.roomId as string;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await participantService.deleteParticipant(participantName, roomId);
|
await participantService.deleteParticipant(participantName, roomId);
|
||||||
|
|||||||
@ -4,3 +4,4 @@ export * from './room.routes.js';
|
|||||||
export * from './auth.routes.js';
|
export * from './auth.routes.js';
|
||||||
export * from './livekit.routes.js';
|
export * from './livekit.routes.js';
|
||||||
export * from './participant.routes.js';
|
export * from './participant.routes.js';
|
||||||
|
export * from './meeting.routes.js';
|
||||||
|
|||||||
23
backend/src/routes/meeting.routes.ts
Normal file
23
backend/src/routes/meeting.routes.ts
Normal 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
|
||||||
|
);
|
||||||
@ -12,6 +12,7 @@ import {
|
|||||||
} from './utils/path-utils.js';
|
} from './utils/path-utils.js';
|
||||||
import {
|
import {
|
||||||
authRouter,
|
authRouter,
|
||||||
|
internalMeetingRouter,
|
||||||
internalParticipantRouter,
|
internalParticipantRouter,
|
||||||
internalRecordingRouter,
|
internalRecordingRouter,
|
||||||
internalRoomRouter,
|
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}/auth`, authRouter);
|
||||||
app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/rooms`, internalRoomRouter);
|
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}/participants`, internalParticipantRouter);
|
||||||
app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/recordings`, internalRecordingRouter);
|
app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/recordings`, internalRecordingRouter);
|
||||||
app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/preferences`, preferencesRouter);
|
app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/preferences`, preferencesRouter);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user