Chat report table working

This commit is contained in:
2021-03-28 07:57:56 +11:00
parent f83ef938ab
commit ab0bad4f73
6 changed files with 92 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
const express = require('express');
const router = express.Router();
//middleware
const tokenAuth = require('../utilities/token-auth');
router.use(tokenAuth);
router.use((req, res, next) => {
//check the user's admin status
if (!req.user.mod) {
return res.status(401).send('Mods only');
}
next();
});
//basic route management
router.get('/reports', require('./reports'));
router.delete('/reports', require('./reports-delete'));
module.exports = router;