A small Symfony application (Symfony 5.3) composed of an API and a frontend developed with the Twig template engine.
The posts and authors are obtained from the external API https://jsonplaceholder.typicode.com
GET /api/posts
GET /api/posts/${id}
Parameter | Type | Description |
---|---|---|
id |
integer |
Required. Id of post to fetch |
GET /api/posts/${id}/author
Parameter | Type | Description |
---|---|---|
id |
integer |
Required. Id of post from which fetch the author |
GET /api/authors
GET /api/authors/${id}
Parameter | Type | Description |
---|---|---|
id |
integer |
Required. Id of author to fetch |
GET /
GET /posts
GET /posts/${id}
Parameter | Type | Description |
---|---|---|
id |
integer |
Required. Id of post to fetch |
A docker-compose.yml has been prepared with an nginx and a docker image of php 7.4.
For the first run
docker-compose up -d
docker-compose exec php composer install
The following executions will only require the first command.
To run tests, run the following command having the containers running.
docker-compose exec php bin/phpunit