Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/constants/creator.constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// src/constants/creator.constants.ts
// Centralized creator route segments used across modules.

/** Base path for creator collection routes. */
export const BASE = '/creators';

/** Root segment for creator module routes. */
export const ROOT = '/';
3 changes: 2 additions & 1 deletion src/modules/creator/creator.routes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// src/modules/creator/creator.routes.ts
import { Router } from 'express';
import { listCreators } from './creator.controller';
import { ROOT as CREATORS_ROOT } from '../../constants/creator.constants';

const router = Router();

Expand All @@ -9,6 +10,6 @@ const router = Router();
* @desc Get a paginated list of creators
* @access Public
*/
router.get('/', listCreators);
router.get(CREATORS_ROOT, listCreators);

export default router;
3 changes: 2 additions & 1 deletion src/modules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import authRouter from './auth/auth.routes';
import healthRouter from './health/health.routes';
import configRouter from './config/config.routes';
import creatorRouter from './creator/creator.routes';
import { BASE as CREATORS_BASE } from '../constants/creator.constants';

const router = Router();

router.use('/health', healthRouter);
router.use('/auth', authRouter);
router.use('/config', configRouter);
router.use('/creators', creatorRouter);
router.use(CREATORS_BASE, creatorRouter);

export default router;
Loading