How to solve CORS policy problem for Strapi?

it’s strapi.config.middlewares not strapi.middleware