diff --git a/README.md b/README.md index f4459d0..177f77c 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,8 @@ mbtiles-extractor --input=some.mbtiles --outputType=local --localOutDir=Data --t `--force=false` Force replace any existing files without asking. +An optional `AWS_S3_ENDPOINT` environment variable may be provided, which is mainly used for S3 compatiable services. eg. `export AWS_S3_ENDPOINT=https://sgp1.digitaloceanspaces.com` if using Digital Ocean Spaces. + #### Local storage options `--localOutDir` **Required** The name of a folder to place the tiles in. diff --git a/src/main.js b/src/main.js index b7c8f4e..5f985dd 100644 --- a/src/main.js +++ b/src/main.js @@ -230,6 +230,9 @@ export async function cli () { agent: defaultAgent } } + if (process.env.AWS_S3_ENDPOINT) { + awsOptions.endpoint = new AWS.Endpoint(process.env.AWS_S3_ENDPOINT) + } if (options.awsProfile) { const profile = await adoptProfile() Object.assign(awsOptions, profile);