Minimalist browser example.

This commit is contained in:
Julien Fontanet 2015-02-05 13:32:39 +01:00
parent 216f895953
commit dd5270f620
5 changed files with 42 additions and 0 deletions

2
packages/xo-lib/example/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/node_modules/
bundle.js

View File

@ -0,0 +1,7 @@
> Minimalist browser example.
```
> npm install
> npm run build
> open index.html
```

View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>xo-lib</title>
</head>
<body>
<script src="bundle.js"></script>
</body>
</html>

View 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);
});

View 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"
}
}