personal_website/routes/api/apiRouter.ts
2024-07-16 15:02:41 +02:00

19 lines
624 B
TypeScript

import express, { type Request, type Response } from "express";
const router = express.Router();
import checkAuthenticated from '../../miscellaneous/checkAuthenticated';
import mediaRouter from './mediaRouter';
import gameRouter from './gameRouter';
import cashTransactionRouter from './cashTransactionRouter';
router.use('/games', gameRouter);
router.use('/movies', mediaRouter);
router.use('/series', mediaRouter);
router.use('/cash', checkAuthenticated, cashTransactionRouter);
router.get('/', function (req: Request, res: Response) {
res.status(200).json({ message: 'API is working' });
});
export default router;