mirror of https://github.com/status-im/codimd.git
Merge pull request #1683 from hackmdio/bugfix/fix-image-upload-s3-config
Fix S3 client config passing for image upload
This commit is contained in:
commit
599fd41c83
|
@ -9,7 +9,16 @@ const logger = require('../logger')
|
||||||
const { S3Client } = require('@aws-sdk/client-s3-node/S3Client')
|
const { S3Client } = require('@aws-sdk/client-s3-node/S3Client')
|
||||||
const { PutObjectCommand } = require('@aws-sdk/client-s3-node/commands/PutObjectCommand')
|
const { PutObjectCommand } = require('@aws-sdk/client-s3-node/commands/PutObjectCommand')
|
||||||
|
|
||||||
const s3 = new S3Client(config.s3)
|
const credentials = {
|
||||||
|
accessKeyId: config.s3.accessKeyId,
|
||||||
|
secretAccessKey: config.s3.secretAccessKey
|
||||||
|
}
|
||||||
|
|
||||||
|
const s3 = new S3Client({
|
||||||
|
credentials,
|
||||||
|
region: config.s3.region,
|
||||||
|
endpoint: config.s3.endpoint
|
||||||
|
})
|
||||||
|
|
||||||
exports.uploadImage = function (imagePath, callback) {
|
exports.uploadImage = function (imagePath, callback) {
|
||||||
if (!imagePath || typeof imagePath !== 'string') {
|
if (!imagePath || typeof imagePath !== 'string') {
|
||||||
|
|
Loading…
Reference in New Issue