ArangoDB v3.7 reached End of Life (EOL) and is no longer supported.

This documentation is outdated. Please see the most recent version here: Latest Docs

Before, after and around

The before, after and around methods can easily be replaced by middleware:


let start;
ctrl.before(function (req, res) {
  start =;
ctrl.after(function (req, res) {
  console.log('Request handled in ', ( - start), 'ms');


router.use(function (req, res, next) {
  let start =;
  console.log('Request handled in ', ( - start), 'ms');

Note that unlike around middleware receives the next function as the third argument (the “opts” argument has no equivalent).