File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -74,13 +74,14 @@ Qiniu-JavaScript-SDK 的示例 Demo 中的服务器端部分是基于[ Node.js
7474└── package.json
7575```
7676
77+ <a id =" usage " ></a >
7778### 准备
7879
7980- JS-SDK 的上传功能基于 [ Plupload] ( http://www.plupload.com/ ) 插件封装的,所以需要[ 下载 Plupload] ( http://plupload.com/download ) ,建议使用 2.1.1 版本。
8081 您也可以访问[ 开放静态文件 CDN ] ( http://staticfile.org/ ) ,搜索 plupload,使用 CDN 加速的静态文件地址。
81- < br >
82+
8283- 在使用 JS-SDK 之前,您必须先注册一个七牛帐号,并登录控制台获取一对有效的 AccessKey 和 SecretKey,您可以阅读[ 如何接入七牛 ] ( http://developer.qiniu.com/article/kodo/kodo-first/quickstart.html ) 和[ 安全机制 ] ( http://developer.qiniu.com/article/kodo/kodo-developer/index.html#security ) 以进一步了解如何正确使用和管理密钥 。
83- < br >
84+
8485- JS-SDK 依赖服务端颁发 uptoken,可以通过以下二种方式实现:
8586 - 利用[ 七牛服务端 SDK ] ( http://developer.qiniu.com/resource/official.html#sdk ) 构建后端服务
8687 - 利用七牛底层 API 构建服务,详见七牛[ 上传策略] ( http://developer.qiniu.com/article/developer/security/put-policy.html ) 和[ 上传凭证] ( http://developer.qiniu.com/article/developer/security/upload-token.html )
@@ -445,6 +446,28 @@ Qiniu-JavaScript-SDK 的示例 Demo 中的服务器端部分是基于[ Node.js
445446
446447 具体管道操作解释见[管道操作](http://developer.qiniu.com/docs/v6/api/overview/fop/pipeline.html)
447448
449+ <a id="demo"></a>
450+ ### 运行示例
451+
452+ 1. 进入项目根目录,执行 `make install` 安装依赖第三方库
453+ 2. 进入 `demo` 目录,按照目录下的 `config.example` 示例,创建 `config.js` 文件,其中,`Access Key` 和 `Secret Key` 按如下方式获取
454+
455+ * [开通七牛开发者帐号](https://portal.qiniu.com/signup)
456+ * [登录七牛开发者自助平台,查看 AccessKey 和 SecretKey](https://portal.qiniu.com/setting/key) 。
457+
458+ ```javascript
459+
460+ module.exports = {
461+ 'ACCESS_KEY': '<Your Access Key>',
462+ 'SECRET_KEY': '<Your Secret Key>',
463+ 'Bucket_Name': '<Your Bucket Name>',
464+ 'Port': 19110,
465+ 'Uptoken_Url': '<Your Uptoken_Url>',
466+ 'Domain': '<Your Bucket Domain>'
467+ }
468+
469+ ```
470+ 3. 进入项目根目录,执行 `make demo` 访问 `http://127.0.0.1:19110/` 或 `http://localhost:19110/`
448471
449472### 说明
450473
You can’t perform that action at this time.
0 commit comments