Add middleware index.js