Merge pull request #486 from kota-row/fix_s3_url
fix s3 us-east-1 region endpoint
This commit is contained in:
commit
3b8f4bc1a2
1 changed files with 4 additions and 1 deletions
|
@ -64,8 +64,11 @@ imageRouter.post('/uploadimage', function (req, res) {
|
||||||
res.status(500).end('upload image error')
|
res.status(500).end('upload image error')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var s3Endpoint = 's3.amazonaws.com'
|
||||||
|
if (config.s3.region && config.s3.region !== 'us-east-1') { s3Endpoint = `s3-${config.s3.region}.amazonaws.com` }
|
||||||
res.send({
|
res.send({
|
||||||
link: `https://s3-${config.s3.region}.amazonaws.com/${config.s3bucket}/${params.Key}`
|
link: `https://${s3Endpoint}/${config.s3bucket}/${params.Key}`
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue