| Name | URL | Actions |
|---|
Uploads a file to the configured GitHub repository.
multipart/form-datafile.200 OK: If the file is successfully uploaded, returns the public URL of the uploaded file.
{
"publicUrl": "https://raw.githubusercontent.com/<repo>/<branch>/uploads/<file_name>"
}
500 Internal Server Error: If the upload fails, an error message is returned.
{
"error": "Failed to upload the file"
}
Retrieves a list of all files uploaded to the GitHub repository.
200 OK: Returns a list of file names with their corresponding public URLs.
[
{
"name": "<file_name>",
"url": "https://raw.githubusercontent.com/<repo>/<branch>/uploads/<file_name>"
},
...
]
500 Internal Server Error: If there is an issue retrieving the file list, an error message is returned.
{
"error": "Failed to retrieve files"
}
Deletes a file from the GitHub repository.
Content-Type: application/json
Body: JSON object with the file name to be deleted.
{
"fileName": "<file_name>"
}
200 OK: If the file is successfully deleted, returns a success message.
{
"message": "File \"<file_name>\" deleted successfully"
}
400 Bad Request: If the file name is not provided in the request body.
{
"error": "File name is required"
}
500 Internal Server Error: If there is an error deleting the file, an error message is returned.
{
"error": "Failed to delete the file"
}