Guest User

Untitled

a guest
Jun 25th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. fetch(url) // or fetch(url, {mode:'cors'})
  2. .then(response => response.json())
  3. .then(data => {
  4.  
  5. cors.config:
  6. enabled: true
  7. # Specify allowed headers, like 'x-allowed-header'.
  8. allowedHeaders: ['x-csrf-token','authorization','content-type','accept','origin','x-requested-with', 'access-control-allow-origin','x-allowed-header','*']
  9. # Specify allowed request methods, specify ['*'] to allow all possible ones.
  10. allowedMethods: ['*'] // or ['POST', 'GET', 'OPTIONS', 'DELETE', 'PUT', 'PATCH']
  11. # Configure requests allowed from specific origins.
  12. allowedOrigins: ['https://XXXX/','*']
  13. # Sets the Access-Control-Expose-Headers header.
  14. exposedHeaders: true // or false
  15. # Sets the Access-Control-Max-Age header.
  16. maxAge: false // or 1000
  17. # Sets the Access-Control-Allow-Credentials header.
  18. supportsCredentials: true // or false
Add Comment
Please, Sign In to add comment