Antoine du Hamel ec87b232e9 meta: enforce `no-unused-vars` linter rule (#3118) 3 years ago
..
.gitignore 030fe49e74 examples: Add the AWS S3 server-side presigned URL example. 7 years ago
composer.json 030fe49e74 examples: Add the AWS S3 server-side presigned URL example. 7 years ago
composer.lock 030fe49e74 examples: Add the AWS S3 server-side presigned URL example. 7 years ago
index.html 4f4a741221 Fix some example names. 7 years ago
main.js 764c2ccada Update Linter (#2796) 4 years ago
package.json c1d15abf10 error on import lint failure + some misc lint fixes (#2813) 4 years ago
readme.md 3c89563f1b examples: make S3 endpoint configurable for aws-presigned-url 5 years ago
s3-sign.php 3c89563f1b examples: make S3 endpoint configurable for aws-presigned-url 5 years ago
serve.js ec87b232e9 meta: enforce `no-unused-vars` linter rule (#3118) 3 years ago

readme.md

Uppy + AWS S3 Example

This example uses a server-side PHP endpoint to sign uploads to S3.

Running It

To run this example, make sure you've correctly installed the repository root:

npm install
npm run build

That will also install the npm dependencies for this example.

This example also uses the AWS PHP SDK. To install it, get composer and run composer update in this folder.

cd ./examples/aws-presigned-url
composer update

Configure AWS S3 credentials using environment variables or a credentials file in ~/.aws/credentials. Configure a bucket name and region in the s3-sign.php file.

Then, again in the repository root, start this example by doing:

npm run example aws-presigned-url

The demo should now be available at http://localhost:8080.

Optionally, provide a port in the PORT environment variable:

PORT=8080 npm run example aws-presigned-url

You can use a different S3-compatible service like GCS by configuring that service in ~/.aws/config and ~/.aws/credentials, and then providing appropriate environment variables:

AWS_PROFILE="gcs" \
COMPANION_AWS_ENDPOINT="https://storage.googleapis.com" \
COMPANION_AWS_BUCKET="test-bucket-name" \
  npm run example aws-presigned-url