middleware.js for middleware init