A simple app to upload images.
- Create a database called
image-app
. - Create a table called
images
in the database. - Copy
api/db-info.php.example
into a new file,api/db-info.php
, and set your DB user infos.
- Method: GET
Fetch images list.
Response:
[{
"avatar": "Image ID",
"path": "Image path",
"name": "Image name",
"description": "Image description"
}]
Upload an image.
- Method: POST
- Content-type:
multipart/form-data
Request:
{
"avatar": "Image file",
"description": "Image description"
}
Response:
{
"message": "API result.",
"infos": "Show error messages if error occurred."
}