1.0.0 • Published 2 years ago

egg-tencent-cloud-cos v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

egg-tencent-cloud-cos

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-tencent-cloud-cos --save

Usage

// {app_root}/config/plugin.js
exports.tencentCloudCos = {
  enable: true,
  package: 'egg-tencent-cloud-cos',
};

Configuration

// {app_root}/config/config.default.js
exports.tencentCloudCos = {
  client: {
    // 用户的 SecretId
    SecretId: 'xxxx21pSuAe9tStAPfv8Ypv8hjfk',
    // 用户的 SecretKey
    SecretKey: 'f8xxxUkqmphNsJblkX9ZoupY6diFtMdnlaEg',
    defaultParams: {
      // 默认使用的桶,在没有配置的情况下默认使用
      Bucket: 'sh-miniprogram-1211135795',
      // 默认使用的区域,在没有配置的情况下默认使用
      Region: 'ap-guangzhou',
    },
  },
};

see config/config.default.js for more detail.

Example

    this.app.tencentCloudCos.getBucket().then(res => {
      console.log(res,'res')
    })

Questions & Suggestions

Please open an issue here.

License

MIT