Skip to content

Instantly share code, notes, and snippets.

@teerasej
Last active September 25, 2016 15:03
Show Gist options
  • Save teerasej/683218e2b3f4135c45166e9669249185 to your computer and use it in GitHub Desktop.
Save teerasej/683218e2b3f4135c45166e9669249185 to your computer and use it in GitHub Desktop.
Enable CorsSlim in Slim Framework 3 Web API
$corsOptions = array(
"origin" => "*",
"exposeHeaders" => array("Content-Type", "X-Requested-With", "X-authentication", "X-client"),
"allowMethods" => array('GET', 'POST', 'PUT', 'DELETE', 'OPTIONS')
);
$cors = new \CorsSlim\CorsSlim($corsOptions);
$app->add($cors);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment