1.0.6 • Published 6 years ago

egg-upyun v1.0.6

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

egg-upyun

currently only supports server access Authorization, and then USES the client (android/ios) to get the key to upload.

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

Install

$ npm i egg-upyun --save

Usage

// {app_root}/config/plugin.js
exports.upyun = {
  enable: true,
  package: 'egg-upyun',
};

Configuration

// {app_root}/config/config.default.js
exports.upyun = {
  name: 'The service name',
  username: 'The operator',
  password: 'Operator password',
  cdnUrl: 'Speed up the domain',
};

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

Example

// {app_root}/XX.js
const paramData = {
        bucket: config.upyun.name, // Upload the space service name.
        expiration: parseInt(new Date().getTime() / 1000 + 60, 10), // The expiration date of the request.
        'allow-file-type': 'jpg,jpeg,png,gif', // The file type
        'content-length-range': '1,1024000',// File size
      };
data = await app.upyun.getPolicyAndAuthorization(paramData);

Introduction

  • this is a cloud service solution.
  • simplified and patted the cloud API without worrying about memory leaks.

Questions & Suggestions

Please open an issue here.

License

MIT

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago