![logo](https://camo.githubusercontent.com/94066e3c64d8e17597a573cd1b7ce8403a9bd587f188b62f48c0835e8a768496/68747470733a2f2f69747a6f6e652e636f6d2e766e2f77702d636f6e74656e742f75706c6f6164732f323032302f30342f53796d666f6e792e6a7067)
Symfony also is useful with API
Identify how create APIs in Symfony, creating and reading post and only reading categories
Server: Symfony 6, API Platform
- Clone this repository.
- Navegate to the project directory
- Run
composer install
to install the dependencies.
- Configure your environment variables.
Type |
Path |
Description |
Params |
GET |
/api/categories |
All categories |
|
{
"id": 0,
"name": "string",
"posts": [
"string"
]
}
Type |
Path |
Description |
Params |
GET |
/api/categories/{id} |
An specific category |
id |
{
"id": 0,
"name": "string",
"posts": [
"string"
]
}
Type |
Path |
Description |
Params |
GET |
/api/posts |
All posts |
|
{
"id": 0,
"title": "string",
"category": {
"id": 0,
"name": "string"
},
"summary": "string"
}
Type |
Path |
Description |
Params |
GET |
/api/posts/{id} |
An specific post |
id |
{
"id": 0,
"title": "string",
"body": "string",
"category": {
"id": 0,
"name": "string"
}
}
Type |
Path |
Description |
Params |
POST |
/api/posts |
Create a post |
title, body, category |
{
"id": 0,
"title": "string",
"body": "string",
"category": "string",
"summary": "string"
}
Type |
Path |
Description |
Params |
PATCH |
/api/posts/{id} |
Update a post |
id, title, body, category |
{
"id": 0,
"title": "string",
"body": "string",
"category": "string",
"summary": "string"
}
![linkedin](https://camo.githubusercontent.com/2b91ca452712585ded21c915eefcf36ea6d69716da98590a76308ab959b61807/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c696e6b6564696e2d3041363643323f7374796c653d666f722d7468652d6261646765266c6f676f3d6c696e6b6564696e266c6f676f436f6c6f723d7768697465)
The Laravel framework is open-sourced software licensed under the MIT license.