1.0.25 • Published 2 years ago
static-upload v1.0.25
static-upload 静态资源上传服务 目前支持阿里云oss 七牛云 以及自己本身服务器
使用方法
npm i static-upload --save引入依赖
const {staticUpload} = require('static-upload')参数说明
QiniuConfig 七牛上传配置
| 字段名 | 描述 |
|---|---|
| accessKey | 七牛accessKey |
| secretKey | 七牛secretKey |
| originPath | 需要上传的目录 |
| filterFiles | 需要过滤的文件名集合 默认:[],如:'index.html' |
| zone | 七牛空间地域 |
| bucket | 七牛bucket |
| debugFlag | 是否开启debug |
| Filterdirectory | 需要过滤的文件夹 |
aliConfig 阿里oss上传配置
| 字段名 | 描述 |
|---|---|
| region | oss region |
| bucket | oss bucket |
| bucketPath | 需要上传的oss指定目录 |
| originPath | 本地需要上传的目录 |
| filterFiles | 需要过滤的文件名集合 默认:[],如:'index.html' |
| accessKeyId | oss accessKeyId |
| accessKeySecret | oss accessKeySecret |
| Filterdirectory | 需要过滤的文件夹 |
serveConfig 云服务器上传配置
| 字段名 | 描述 |
|---|---|
| ip | 服务器ip |
| port | 服务器端口 |
| username | 服务器用户名(一般为root) |
| password | 服务器登录用户名 |
| locationUrl | 本地需要上传文件的url |
| serverUrl | 上传文件的服务器路径 |
| isGzip | 是否是压缩包 |
使用方法
const uploadServe= new staticUpload({
QiniuConfig:{
//七牛配置
},
aliConfig:{
// 阿里oss配置
},
serveConfig:{
//自身服务器配置
}
})
//上传到七牛
uploadServe.qiniuUpload()
//上传到阿里
uploadServe.aliUpload()七牛或者阿里云oss 上传完毕后会调用云服务器上传 如不需要云服务器上传
serveConfig不配置即可
1.0.19
3 years ago
1.0.18
3 years ago
1.0.17
3 years ago
1.0.16
3 years ago
1.0.9
3 years ago
1.0.22
2 years ago
1.0.20
3 years ago
1.0.25
2 years ago
1.0.24
2 years ago
1.0.23
2 years ago
1.0.11
3 years ago
1.0.10
3 years ago
1.0.15
3 years ago
1.0.14
3 years ago
1.0.13
3 years ago
1.0.12
3 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.0
4 years ago