Minimalist browser example.
This commit is contained in:
parent
216f895953
commit
dd5270f620
2
packages/xo-lib/example/.gitignore
vendored
Normal file
2
packages/xo-lib/example/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/node_modules/
|
||||||
|
bundle.js
|
7
packages/xo-lib/example/README.md
Normal file
7
packages/xo-lib/example/README.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
> Minimalist browser example.
|
||||||
|
|
||||||
|
```
|
||||||
|
> npm install
|
||||||
|
> npm run build
|
||||||
|
> open index.html
|
||||||
|
```
|
9
packages/xo-lib/example/index.html
Normal file
9
packages/xo-lib/example/index.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>xo-lib</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script src="bundle.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
13
packages/xo-lib/example/index.js
Normal file
13
packages/xo-lib/example/index.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
//====================================================================
|
||||||
|
|
||||||
|
var Xo = require('..');
|
||||||
|
|
||||||
|
//====================================================================
|
||||||
|
|
||||||
|
var xo = new Xo('localhost:9000');
|
||||||
|
|
||||||
|
xo.call('system.getMethodsInfo').then(function (methods) {
|
||||||
|
console.log(methods);
|
||||||
|
});
|
11
packages/xo-lib/example/package.json
Normal file
11
packages/xo-lib/example/package.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"build": "browserify --outfile bundle.js index.js",
|
||||||
|
"dev": "watchify --debug --outfile bundle.js index.js"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"browserify": "^8.1.3",
|
||||||
|
"watchify": "^2.3.0"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user