Skip to content

Instantly share code, notes, and snippets.

@TaylorAckley
Last active October 8, 2018 00:39
Show Gist options
  • Select an option

  • Save TaylorAckley/944fa228732339198a475ced3577c7df to your computer and use it in GitHub Desktop.

Select an option

Save TaylorAckley/944fa228732339198a475ced3577c7df to your computer and use it in GitHub Desktop.
MVC - Routes
const AuthStore = require('../stores/authentication.store');
module.exports = function(app) {
app.use('/api/v1', require('./routes.unauth'));
app.use('/api/v1', [AuthStore.authenticate], require('./routes.auth'));
app.use('/api/v1/admin', [AuthStore.authenticate, AuthStore.isAdmin], require('./routes.admin'));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment