import express from 'express';
import authMiddleware from '../middlewares/auth';
import mongoose from '../../database';
const router = express.Router();
let acl = require('acl');
acl = new acl(new acl.mongodbBackend(mongoose.connection.db, 'acl_'));
acl.allow("admin", "/projects", "*");
router.use(authMiddleware);
router.use(acl.middleware());
router.get('/', (req, res) => {
res.send({
ok: true,
user: req.userId
})
});
export default (app) => app.use('/projects', router);
Did I miss something?
Thank you!