At root project folder please run:
composer install
Then rename .env.example to .env and run:
php artisan key:generate
Please make sure folder and subfolder in storage has write permission.
{url} is your domain, example my domain is: http://huyhvq.app
- Upload file endpoint: {url}/api make POST request with body content as file binary and parameter name as filename. Example:
curl --request POST --data-binary "@filename" --data="key=value" $URL
We can use bellow command for upload:
curl -v --request POST --data-binary "@dota.jpg" --data "name=dota2.jpg" http://huyhvq.app/api
- Retrieve file endpoint: {url}/api/{filename} method GET
curl GET $URL
My uploaded file is dota2.jpg
curl -v GET http://huyhvq.app/api/dota2.jpg
- Delete file endpoint: {url}/api/{filename} method DELETE
curl -X DELETE $URL
My uploaded file is dota2.jpg
curl -v -X DELETE http://huyhvq.app/api/dota2.jpg
Please run:
vendor/bin/phpunit
at root project folder.