This service provides an interface to S3 for worry-free uuid-based upload/download of assets.
Setup Virual Env and Install requirements as given in Method 2 below:
python -m unittest /assetstorageservice/tests/test_asset_dao.py
Use the provided docker compose file and run the command:
-
docker-compose -f app_compose.yml up
-
Use Postman Collection for APIs: https://www.getpostman.com/collections/29e71952fd3e4a434c46
-
For File Upload: curl -v -XPUT -T /path/to/file 'https://url-provided-by-post'
-
Clone the repository: https://github.com/priteshgudge/assetstorageservice.git and install/run mongo 3.6
-
Setup Virtual Environment: $virtualenv python3asststr -p python3.4 $source python3asststr/bin/activate
-
Install Requirements File: pip install -r requirements.txt
-
Change Directory to go to project folder
-
Run Below Export Command:
$export AWS_ACCESS_KEY_ID="<AWS_ACCESS_KEY_ID>";export AWS_SECRET_ACCESS_KEY="<AWS_SECRET_ACCESS_KEY>";export PYTHONPATH=$PWD
-
Run service app: $python assetstorageservice/conf/service_app.py
-
Use the PostMan Collections to hit the APIs:
Postman Collection: https://www.getpostman.com/collections/29e71952fd3e4a434c46
- Use the sample Curl command to Upload the file: curl -v -XPUT -T /path/to/sample_file.txt 'https://s3urlprovidedbyservice'
Eg. curl -v -XPUT -T /tmp/go-code-check 'https://s3urlprovidedbyservice'
https://medium.com/backticks-tildes/restful-api-design-put-vs-patch-4a061aa3ed0b