Guest User

Untitled

a guest
Jan 18th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. $app->options('/{routes:.+}', function ($request, $response, $args) {
  2. return $response;
  3. });
  4.  
  5. $app->add(function ($req, $res, $next) {
  6. $response = $next($req, $res);
  7. return $response
  8. ->withHeader('Access-Control-Allow-Origin', '*')
  9. ->withHeader('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type, Accept, Origin, Authorization')
  10. ->withHeader('Access-Control-Allow-Methods', 'GET, POST, DELETE, PUT, OPTIONS');
  11. });
Add Comment
Please, Sign In to add comment