Skip to content

Instantly share code, notes, and snippets.

@petersirka
Created June 14, 2016 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petersirka/e81a923350ccd57c1ed3def504a37a2a to your computer and use it in GitHub Desktop.
Save petersirka/e81a923350ccd57c1ed3def504a37a2a to your computer and use it in GitHub Desktop.
exports.install = function() {
F.route('/', view_a, ['#A']);
F.route('/*', view_b, ['#B']);
}
F.middleware('A', function(req, res, next, options, controller) {
console.log('A');
next();
});
F.middleware('B', function(req, res, next, options, controller) {
console.log('B');
next();
});
function view_a() {
this.plain('A');
}
function view_b() {
this.plain('B');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment