aboutsummaryrefslogtreecommitdiffstats
path: root/examples/hybrid-html5/README.md
blob: f9119a688e6d86c7067dfedadb45e583e4562089 (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Template Hybrid HTML5 Application for Application Framework Binder

## Setup

Install HTML5 development toolchain on your host

```
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
$ sudo apt-get install nodejs
$ sudo npm install --global gulp

```

Then install NodeJS dependencies 

```
$ cd html5     # or the project directory
$ npm install
```

## Overload ./app/etc/AppDefaults.js with '.noderc.js'

```
    var config= {
        APPNAME : 'xxxxxx-hybrid-html5',   // AppName is use as main Angular Module name
        FRONTEND: "Frontend",    // HTML5 frontend  [no leading ./]
        BACKEND : "Backend",     // NodeJS Rest API [no leading ./]
        URLBASE : '/opa/',       // HTML basedir when running in production [should end with a /]
        APIBASE : '/api/',       // Api url base dir [should end with a /]
    };
    module.exports = config;
```

WARNING: in current development version Frontend/services/AppConfig.js is not updated automatically
you should manually assert that backend config is in sync with frontend config.

## Build widget

```
$ mkdir build && cd build
$ cmake ..
$ make
```

This should give a .wgt file ready to be deployed on the target.

## Deploy application package

Run:

```
$ scp *.wgt root@$BOARDIP:~/
$ ssh root@$BOARDIP
# afm-util install xxxxxx-hybrid-html5.wgt
# afm-util start xxxxxx-hybrid-html5@0.1
```