Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $app->options('/{routes:.+}', function ($request, $response, $args) {
- return $response;
- });
- $app->add(function ($req, $res, $next) {
- $response = $next($req, $res);
- return $response
- ->withHeader('Access-Control-Allow-Origin', '*')
- ->withHeader('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type, Accept, Origin, Authorization')
- ->withHeader('Access-Control-Allow-Methods', 'GET, POST, DELETE, PUT, OPTIONS');
- });
Add Comment
Please, Sign In to add comment