Closed dunglas closed 6 years ago
Since this makes sense for most users Im all :+1:
I'm still unsure about that because I don't see why an API could not exists without CORS, it's not a "required" feature for the api to work (at least users should know that an API doesn't need to allow cross origin request to work). Anyway, if users are having a hard time doing composer req cors
, let's add it to the stack!
@soyuka the goal of the pack is to have an "out of the box" solution handling most common cases. As api-platform/core
doesn't deal with CORS at all, the user can still remove NelmioCors if he doesn't want it.
Thank you @dunglas.
Many people struggle to properly configure CORS handling when creating an API with Symfony 4. To solve this problem, this PR adds NelmioCors (that now has a dedicated Flex recipe) to the pack.
Thanks to the new Flex's unpack feature, adding an extra dependency in the pack isn't a big deal anymore, because the user can easily remove it if he wants to customize the installation.
Another advantage of this PR: it will reduce the gap between the standard API Platform distribution and
composer req api
.