Update example.js

Updating example with before/after route hooks.