summaryrefslogtreecommitdiff
path: root/lib/web/imageRouter/s3.js
diff options
context:
space:
mode:
authorSheogorath2019-09-02 18:50:29 +0300
committerGitHub2019-09-02 18:50:29 +0300
commit2e627099d895035d900bbb7aba656ce7d008c233 (patch)
treefd2393adde86b17c9926c01e3debafeb0987c2b8 /lib/web/imageRouter/s3.js
parent2b0300e2f2c41ee3bb0d7327e10fbe065b5e277a (diff)
parent9613197f5d26efd699a00e322dc12a862ea3417b (diff)
Merge pull request #32 from codimd/aws-endpoints
make aws s3 endpoint configurable
Diffstat (limited to 'lib/web/imageRouter/s3.js')
-rw-r--r--lib/web/imageRouter/s3.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/web/imageRouter/s3.js b/lib/web/imageRouter/s3.js
index 4effea04..2bf08cc7 100644
--- a/lib/web/imageRouter/s3.js
+++ b/lib/web/imageRouter/s3.js
@@ -43,7 +43,9 @@ exports.uploadImage = function (imagePath, callback) {
}
let s3Endpoint = 's3.amazonaws.com'
- if (config.s3.region && config.s3.region !== 'us-east-1') {
+ if (config.s3.endpoint) {
+ s3Endpoint = config.s3.endpoint
+ } else if (config.s3.region && config.s3.region !== 'us-east-1') {
s3Endpoint = `s3-${config.s3.region}.amazonaws.com`
}
callback(null, `https://${s3Endpoint}/${config.s3bucket}/${params.Key}`)