About cors, middleware.js and migration

Hi pal, I am newbe on strapi inside programming…
I am a front-end developer and chose strapi as back-end in order to keep developing my app on a straightforward way.
I know my problem is a common one and in older version of strapi I solved the problem.
My problem is with cors and connect my app from my devices.
In older version was enough configurating strapi/config/enviroments/develop/security.json but this way doesn’t work anymore.
I read middleware topic and made this middelware.js:
module.exports = {
time: 100,
load: {
before: [‘timer’, ‘responseTime’, ‘logger’, ‘cors’, ‘responses’, ‘gzip’],
after: [‘parser’, ‘router’],
settings: {
cors: {
enabled: true,
headers: ‘’,
origin: '
methods: [‘GET’, ‘POST’, ‘PUT’, ‘PATCH’, ‘DELETE’, ‘OPTIONS’, ‘HEAD’],

It doesn’t work. In my opinion there is so few documentation respect that and it is vague. I keep some doubts respect that.
For example, using middleware.js, do we need to use json config files?
for cors, do we need to create middleware and cors folder with its repective index.js?
what else do we need for cors issue?

thanks a lot beforehand…