@shun-js/cos 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -0
- package/package.json +2 -3
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# @shun-js/cos
|
|
2
|
+
|
|
3
|
+
shun.js服务:推荐服务
|
|
4
|
+
|
|
5
|
+
## 配置文件
|
|
6
|
+
|
|
7
|
+
以`cos.json`命名
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"port": 8005
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## 启动
|
|
16
|
+
|
|
17
|
+
```shell
|
|
18
|
+
# 全局安装该服务
|
|
19
|
+
npm i -g @shun-js/user
|
|
20
|
+
|
|
21
|
+
# 安装shun-cli
|
|
22
|
+
npm i -g @shun-js/shun-cli
|
|
23
|
+
|
|
24
|
+
# 启动,在cos.json所在目录下
|
|
25
|
+
shunjs start @shun-js/cos
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## 请求
|
|
29
|
+
|
|
30
|
+
```shell
|
|
31
|
+
# cos token
|
|
32
|
+
curl --location --request POST 'http://localhost:8005/cos/token' \
|
|
33
|
+
--data-urlencode 'cosSecretId=xx' \
|
|
34
|
+
--data-urlencode 'cosSecretKey=xx' \
|
|
35
|
+
--data-urlencode 'cosBucket=xx' \
|
|
36
|
+
--data-urlencode 'cosRegion=ap-beijing' \
|
|
37
|
+
--data-urlencode 'durationSeconds=1800' \
|
|
38
|
+
--data-urlencode 'allowPrefix=models/*'
|
|
39
|
+
|
|
40
|
+
# cos sign
|
|
41
|
+
curl --location --request POST 'http://localhost:8005/cos/sign' \
|
|
42
|
+
--data-urlencode 'cosSecretId=xx' \
|
|
43
|
+
--data-urlencode 'cosSecretKey=xx' \
|
|
44
|
+
--data-urlencode 'cosBucket=xx' \
|
|
45
|
+
--data-urlencode 'cosRegion=ap-beijing' \
|
|
46
|
+
--data-urlencode 'signKey=xx' \
|
|
47
|
+
--data-urlencode 'signTimeout=60' \
|
|
48
|
+
--data-urlencode 'cdnHost=1800' \
|
|
49
|
+
--data-urlencode 'filePath=models/*' \
|
|
50
|
+
--data-urlencode 'formatWebp=no' \
|
|
51
|
+
--data-urlencode 'formatWidth=150'
|
|
52
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shun-js/cos",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "cos",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shun.js",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@shun-js/shun-config": "^0.3.1",
|
|
25
|
-
"@shun-js/shun-service": "^0.3.1",
|
|
26
25
|
"qiao-cos": "^5.0.6",
|
|
27
26
|
"qiao-log": "^5.1.9",
|
|
28
27
|
"qiao-z": "^5.8.9"
|
|
@@ -31,5 +30,5 @@
|
|
|
31
30
|
"access": "public",
|
|
32
31
|
"registry": "https://registry.npmjs.org/"
|
|
33
32
|
},
|
|
34
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "405fc74a5b002f7399cee6df132c7c2c039be09e"
|
|
35
34
|
}
|