personal_website/routes/api/apiRouter.js
2024-07-16 14:24:01 +02:00

18 lines
622 B
JavaScript

var express = require('express');
var router = express.Router();
const checkAuthenticated = require('../../miscellaneous/checkAuthenticated.js').default;
var mediaRouter = require('./mediaRouter');
var gameRouter = require('./gameRouter');
var cashTransactionRouter = require('./cashTransactionRouter');
router.use('/games', gameRouter);
router.use('/movies', mediaRouter);
router.use('/series', mediaRouter);
router.use('/cash', checkAuthenticated, cashTransactionRouter);
router.get('/', function (req, res, next) {
res.status(200).json({ message: 'API is working' });
});
module.exports = router;