December 2016
Beginner to intermediate
1005 pages
21h 54m
English
Drupal 8 uses Composer for package dependencies and autoloading classes based on PSR standards. This allows us to use any available PHP library much more easily than in previous versions of Drupal.
In this recipe, we will add the Stack/Cors library to add CORS support to Drupal 8. Stack/Cors is a stack middleware that adds support to the Access-Control-Allow-Origin header used in web applications. Without specification, AJAX requests across different domains may fail.
In order to test CORS, you will need to make a cross-domain asynchronous JavaScript request. The Access-Control-Allow-Origin header defines domains that are allowed to perform these requests.
You need to have Composer ...
Read now
Unlock full access