Assign configurations in global.js. Add MIDDLEWARE_DIR to global variables.