mirror of https://github.com/status-im/codimd.git
refactor: fix lint on lib/web/imageRouter/minio.js
Signed-off-by: BoHong Li <raccoon@hackmd.io>
This commit is contained in:
parent
0c9195b731
commit
c8ffd2ab19
|
@ -32,16 +32,16 @@ exports.uploadImage = function (imagePath, callback) {
|
|||
return
|
||||
}
|
||||
|
||||
let key = path.join('uploads', path.basename(imagePath))
|
||||
let protocol = config.minio.secure ? 'https' : 'http'
|
||||
const key = path.join('uploads', path.basename(imagePath))
|
||||
const protocol = config.minio.secure ? 'https' : 'http'
|
||||
|
||||
minioClient.putObject(config.s3bucket, key, buffer, buffer.size, getImageMimeType(imagePath), function (err, data) {
|
||||
if (err) {
|
||||
callback(new Error(err), null)
|
||||
return
|
||||
}
|
||||
let hidePort = [80, 443].includes(config.minio.port)
|
||||
let urlPort = hidePort ? '' : `:${config.minio.port}`
|
||||
const hidePort = [80, 443].includes(config.minio.port)
|
||||
const urlPort = hidePort ? '' : `:${config.minio.port}`
|
||||
callback(null, `${protocol}://${config.minio.endPoint}${urlPort}/${config.s3bucket}/${key}`)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue