E
E
Erl2020-09-15 19:11:18
API
Erl, 2020-09-15 19:11:18

How to enable cors in strapi?

along the path /config/environments/development/security.json
I posted the following code

{
  "cors": {
    "enabled": true,
    "origin": "*",
    "expose": [
      "WWW-Authenticate",
      "Server-Authorization",
      "Access-Control-Expose-Headers"
    ],
    "maxAge": 31536000,
    "credentials": true,
    "methods": ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"],
    "headers": [
      "Content-Type",
      "Authorization",
      "X-Frame-Options",
      "Origin",
      "Access-Control-Allow-Headers"
    ]
  }
}


but still i can't make requests

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question