Skip to content

Instantly share code, notes, and snippets.

@elmarputz
Created March 6, 2017 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elmarputz/c67366e3dfc6c2a157bc4ae8b9e3eaa2 to your computer and use it in GitHub Desktop.
Save elmarputz/c67366e3dfc6c2a157bc4ae8b9e3eaa2 to your computer and use it in GitHub Desktop.
bootstrap.php
//zu Beginn
/* needed to prevent CORS errors, when cakephp throws an exception */
header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
header('Access-Control-Allow-Methods: *');
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Request-Method: *');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization');
...
//am Ende
use Cake\Routing\DispatcherFactory;
DispatcherFactory::add('Asset');
DispatcherFactory::add('Routing');
DispatcherFactory::add('ControllerFactory');
DispatcherFactory::add('REST', ['priority' => 1]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment