-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add browser sample,modify some code to support compression
- Loading branch information
伯箫
committed
Dec 5, 2017
1 parent
1581465
commit 63c4b27
Showing
10 changed files
with
100 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
- 阿里云表格存储是阿里云自主研发的NoSQL数据存储服务,提供海量结构化数据的存储和实时访问。 | ||
|
||
## 版本 | ||
- 当前版本:4.0.8 | ||
- 当前版本:4.0.9 | ||
|
||
## 安装 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
## 在浏览器端使用 | ||
|
||
现在 tablestore-js-sdk 只支持特定的实例在浏览器端调用, 如果需要在浏览器中使用,请通过钉钉联系我们,将您的实例在后端做一下处理。 | ||
使用方式请参考 sample/browser/index.html。 | ||
|
||
### 如何 build | ||
|
||
目前在浏览器端运行的 sdk 还在测试阶段, 如果有问题请随时提出, 如果需要自己转换js sdk请按照以下步骤操作: | ||
|
||
- git clone https://github.com/aliyun/aliyun-tablestore-nodejs-sdk.git | ||
- cd aliyun-tablestore-nodejs-sdk | ||
- npm install | ||
- bower install | ||
- npm install -g browserify | ||
|
||
```sh | ||
browserify browser.js > tablestore-js-sdk.js | ||
``` | ||
|
||
使用uglijs压缩: | ||
```sh | ||
uglifyjs tablestore-js-sdk.js -o tablestore-js-sdk.min.js | ||
``` | ||
|
||
## 初始化 | ||
|
||
```javascript | ||
考虑安全问题,请使用 STS token 初始化 TableStore Client | ||
``` | ||
|
||
```javascript | ||
var stsTokenClient = new TableStore.Client({ | ||
accessKeyId: "sts token 中的 accessKeyId", | ||
secretAccessKey: "sts token 中的 secretAccessKey", | ||
securityToken: "sts token 中的 securityToken", | ||
endpoint: ' <your endpoint>', | ||
instancename: '<your instance name>' | ||
}); | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!DOCTYPE html> | ||
<html lang="zh-CN"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<title>tablestore-js-sdk demo</title> | ||
</head> | ||
|
||
<body> | ||
<script src="./tablestore-js-sdk-4.0.9.min.js"></script> | ||
<script> | ||
var Long = TableStore.Long; | ||
|
||
var client = new TableStore.Client({ | ||
accessKeyId: "sts token accessKeyId", | ||
secretAccessKey: "sts token secretAccessKey", | ||
securityToken: "sts token securityToken", | ||
endpoint: ' <your endpoint>', | ||
instancename: '<your instance name>' | ||
}); | ||
|
||
client.listTable({}, function (err, data) { | ||
if (err) { | ||
console.log('error:', err); | ||
return; | ||
} | ||
console.log('success:', data); | ||
}); | ||
|
||
|
||
</script> | ||
</body> | ||
|
||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters