move production/development settings prior to middleware init