Basic HTTP API for file uploading to S3-compatible storage
Due to localstack usage, awscli
tool is needed for local development.
Install it on mac via brew install awscli
Before running local project, run:
aws configure
and set up AWS keys. Don't forget to add them to docker-compose.yml
Then, set up bucket using folowing commands:
aws --endpoint-url=http://localhost:4572 s3 mb s3://file-storage
aws --endpoint-url=http://localhost:4572 s3api put-bucket-acl --bucket file-storage --acl public-read
Use make run
to build and run docker containers with application itself and mongodb instance
Used to upload image for publication
{
"status": "ok",
"url": "http://localhost:4572/file-storage/XVlBzgbaiCMRAjWw"
}
{
"status": "error",
"url": "failed to open image"
}