Express.js middleware to trap 404 and 500 errors.