Skip to content

Commit 236b694

Browse files
committed
Add API Platform
composer add api
1 parent bf4caf9 commit 236b694

8 files changed

+401
-1
lines changed

.env

+4
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ APP_SECRET=8b885957e4407b0b5f97ff8f91f6c3e9
3030
# DATABASE_URL="mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7"
3131
DATABASE_URL="postgresql://db_user:[email protected]:5432/db_name?serverVersion=13&charset=utf8"
3232
###< doctrine/doctrine-bundle ###
33+
34+
###> nelmio/cors-bundle ###
35+
CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$'
36+
###< nelmio/cors-bundle ###

composer.json

+2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
"php": ">=7.2.5",
88
"ext-ctype": "*",
99
"ext-iconv": "*",
10+
"api-platform/core": "^2.6",
1011
"composer/package-versions-deprecated": "1.11.99.1",
1112
"doctrine/annotations": "^1.0",
1213
"doctrine/doctrine-bundle": "^2.3",
1314
"doctrine/doctrine-migrations-bundle": "^3.1",
1415
"doctrine/orm": "^2.8",
16+
"nelmio/cors-bundle": "^2.1",
1517
"phpdocumentor/reflection-docblock": "^5.2",
1618
"sensio/framework-extra-bundle": "^5.1",
1719
"symfony/asset": "5.2.*",

composer.lock

+337-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/bundles.php

+2
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@
1212
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
1313
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
1414
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
15+
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
16+
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
1517
];

0 commit comments

Comments
 (0)