Skip to content

Instantly share code, notes, and snippets.

@navarroaxel
Created June 2, 2014 17:12
Show Gist options
  • Select an option

  • Save navarroaxel/b86aa5ce8ad4b26a2b85 to your computer and use it in GitHub Desktop.

Select an option

Save navarroaxel/b86aa5ce8ad4b26a2b85 to your computer and use it in GitHub Desktop.
A user with the correct permission can use the users API
var router = require('express').Router();
router.use(require('permission.js')('manageUsers'));
/* GET users listing. */
router.get('/', function(req, res) {
res.send('respond with a resource');
});
/* GET a user */
router.get('/:id', function(req, res) {
res.send('This is the user id ' + req.params.id);
});
module.exports = router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment