-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
example: migrate
digitalocean-spaces
to ESM (#4015)
- Loading branch information
Showing
9 changed files
with
76 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Uploading to DigitalOcean Spaces | ||
|
||
This example uses Uppy to upload files to a DigitolOcean Space. DigitalOcean Spaces has an identical API to S3, so we can use the [AwsS3](https://uppy.io/docs/aws-s3) plugin. We use @uppy/companion with a [custom `endpoint` configuration](./server.cjs#L39) that points to DigitalOcean. | ||
|
||
## Running it | ||
|
||
To run this example, make sure you've correctly installed the **repository root**: | ||
|
||
```bash | ||
corepack yarn install | ||
corepack yarn build | ||
``` | ||
|
||
That will also install the dependencies for this example. | ||
|
||
First, set up the `COMPANION_AWS_KEY`, `COMPANION_AWS_SECRET`, | ||
`COMPANION_AWS_REGION`, and `COMPANION_AWS_BUCKET` environment variables for | ||
`@uppy/companion` in a `.env` file. You may find useful to first copy the | ||
`.env.example` file: | ||
|
||
```sh | ||
[ -f .env ] || cp .env.example .env | ||
``` | ||
|
||
Then you can start the dev server: | ||
|
||
```bash | ||
corepack yarn workspace @uppy-example/digitalocean-spaces start | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
{ | ||
"name": "@uppy-example/digitalocean-spaces", | ||
"version": "0.0.0", | ||
"type": "module", | ||
"dependencies": { | ||
"@babel/core": "^7.2.2", | ||
"@uppy/aws-s3": "workspace:*", | ||
"@uppy/core": "workspace:*", | ||
"@uppy/dashboard": "workspace:*", | ||
"babelify": "^10.0.0", | ||
"body-parser": "^1.18.3", | ||
"budo": "^11.6.1", | ||
"cors": "^2.8.5", | ||
"router": "^1.3.3" | ||
"cors": "^2.8.5" | ||
}, | ||
"devDependencies": { | ||
"dotenv": "^16.0.1", | ||
"express": "^4.16.2", | ||
"vite": "^3.0.0" | ||
}, | ||
"private": true, | ||
"scripts": { | ||
"start": "node ./server.js" | ||
"start": "node ./server.cjs" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters