Skip to content

Instantly share code, notes, and snippets.

@yask123
Created October 24, 2015 03:58
Show Gist options
  • Select an option

  • Save yask123/6d24f9ee3e6dda1ff7d2 to your computer and use it in GitHub Desktop.

Select an option

Save yask123/6d24f9ee3e6dda1ff7d2 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title> App Base</title>
<script src="bower_components/appbase-js/browser/appbase.js"></script>
</head>
<body>
<h1>Hey</h1>
<script type="text/javascript">
var appbase = new Appbase({
url: 'https://scalr.api.appbase.io',
appname: 'createnewtestapp01',
username: 'RIvfxo1u1',
password: 'dee8ee52-8b75-4b5b-be4f-9df3c364f59f'
});
var jsonObject = {
"count":1
}
appbase.index({
type: 'books',
id: '1',
body: jsonObject
}).on('data', function(response) {
console.log(response);
}).on('error', function(error) {
console.log(error);
});
appbase.readStream({
type: "books",
id: 1,
streamonly: false
}).on('data', function(res) {
console.log("data update: ", res);
}).on('error', function(err) {
console.log("streaming error: ", err);
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment