forked from contentstack/contentstack-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
29 lines (24 loc) · 952 Bytes
/
index.js
File metadata and controls
29 lines (24 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict'
const ContentstackDemo = require('./contentstack-demo.js')
//const Demo = new ContentstackDemo({ 'api_key': "blt292960b854e5170e", 'access_token': "blt468d2af41a0f061c", 'environment': "development"})
const Demo = new ContentstackDemo({ 'api_key': "", 'access_token': "", 'environment': ""})
//get all the entries
Demo.getContentTypedemo()
.then(function(result, err) {
// console.log("Result>>>>>>>>>>>>>>>")
try {
if (err || !result) {
console.log("Result>>>>>>>>>>>>>>>")
console.log(err)
} else {
console.log("Result: ", JSON.stringify(result, null, 1))
//console.info("Result: ", JSON.stringify(result))
}
} catch (e) {
return reject(e);
}
})
.catch(function(err) {
// error of get all entries
console.error("Find Error :", err)
})