File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,26 +7,24 @@ A js-library to interact with Semanic Container.
77## Example
88
99``` javascript
10- import { Semcon } from ' semcon-js/dist/module'
11-
12- const semcon = new Semcon (
13- ' https://playground.data-container.net' ,
14- {
15- appKey: ' app_key' ,
16- appSecret: ' super_secret' ,
17- },
18- );
19-
20- // authenticate Semcon against a data container
21- await semcon .initialize ();
22-
23- // check if provided data is valid and Semcon is authenticated (optional)
24- console .log (` connection is ${ semcon .isValid () ? ' valid' : ' invalid' } ` );
25-
26- // send data
27- await semcon .postItem ({
28- foo: ' bar' ,
29- });
10+ import { Semcon } from ' semcon-js' ;
11+
12+ async function main () {
13+
14+ # connect data container
15+ const semcon = new Semcon (' https://playground2.data-container.net' );
16+ await semcon .initialize ();
17+
18+ // check if provided data is valid
19+ const isValid = await semcon .isValid ();
20+ console .log (` connection is ${ isValid ? ' valid' : ' invalid' } ` );
21+
22+ // read a record
23+ const item = await semcon .getItem ({id: 110 });
24+ console .log (' data:' , item);
25+ }
26+
27+ main ().catch (console .error );
3028```
3129
3230## Install
You can’t perform that action at this time.
0 commit comments