ADD: Bucket and Upload System ADD: New errors ADD: Virtuals for categories ADD: Features system ADD: File management system
31 lines
614 B
JavaScript
31 lines
614 B
JavaScript
const Minio = require('minio')
|
|
|
|
const endPoint = process.env.AWS_ENDPOINT
|
|
const accessKey = process.env.AWS_ACCESS_KEY
|
|
const secretKey = process.env.AWS_SECRET_KEY
|
|
const region = process.env.AWS_REGION
|
|
const port = parseInt(process.env.AWS_PORT)
|
|
|
|
let client
|
|
|
|
if (process.env.NODE_ENV === 'test') {
|
|
client = new Minio.Client({
|
|
endPoint,
|
|
useSSL: true,
|
|
accessKey,
|
|
port,
|
|
secretKey,
|
|
region,
|
|
})
|
|
} else {
|
|
client = new Minio.Client({
|
|
endPoint,
|
|
useSSL: true,
|
|
accessKey,
|
|
secretKey,
|
|
region,
|
|
})
|
|
}
|
|
|
|
module.exports = client
|