Using symfony 6.2 with api-platform/core and successfully created several dynamic routes based on #[ApiResources] annotations on Entity classes. The localhost environment (mac) http://localhost:8001/api/docs successfully displays the docs and all the endpoints work; However, when deployed to an AWS instance the /api routes all get a 404 error. When I set the document root to /public I do successfully get the default symfony web page.
The AWS deployment:
Platform & Solution Stack Name: PHP 8.1 AL2 version 3.5.2 (64bit Amazon Linux 2 v3.5.2 running PHP 8.1)
Language: PHP 8.1.13
Composer: 2.3.5
Proxy Server: nginx 1.22.0
The config/packages and config/routes where not altered from the initial composer generated install
app/config/routes/api_plaform.yaml
api_platform:
resource: .
type: api_platform
prefix: /api
app/config/routes.yaml
controllers:
resource:
path: ../src/Controller/
namespace: App\Controller
type: attribute
Each Entity.php class has this kind of #[ApiResource] Annotation:
#[ORM\Entity(repositoryClass: ProjectRepository::class)]
#[ORM\EntityListeners(['App\EventListener\ProjectChangedNotifier'])]
#[ApiResource(
normalizationContext: ['groups' => ['read']],
denormalizationContext: ['groups' => ['write']]
)]
class Project
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
...
Any ideas on how to debug the routes on the AWS instance?