How to solve CORS policy problem for Strapi?

I am having a similar issue and would like to see the what is running in my middleware.js, but if I use the strapi.middleware command I get the output [Function: middleware] .