Continue separation of sources and put also html5 into separated dir
[staging/xdg-launcher.git] / templates / hybrid-html5 / README.md
1 # Template Hybrid HTML5 Application for Application Framework Binder
2
3 ## Setup
4
5 Install HTML5 development toolchain on your host
6
7 ```
8 $ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
9 $ sudo apt-get install nodejs
10 $ sudo npm install --global gulp
11
12 ```
13
14 Then install NodeJS dependencies 
15
16 ```
17 $ cd html5     # or the project directory
18 $ npm install
19 ```
20
21 ## Overload ./app/etc/AppDefaults.js with '.noderc.js'
22
23 ```
24     var config= {
25         APPNAME : 'xxxxxx-hybrid-html5',   // AppName is use as main Angular Module name
26         FRONTEND: "Frontend",    // HTML5 frontend  [no leading ./]
27         BACKEND : "Backend",     // NodeJS Rest API [no leading ./]
28         URLBASE : '/opa/',       // HTML basedir when running in production [should end with a /]
29         APIBASE : '/api/',       // Api url base dir [should end with a /]
30     };
31     module.exports = config;
32 ```
33
34 WARNING: in current development version Frontend/services/AppConfig.js is not updated automatically
35 you should manually assert that backend config is in sync with frontend config.
36
37 ## Build widget
38
39 ```
40 $ mkdir build && cd build
41 $ cmake ..
42 $ make
43 ```
44
45 This should give a .wgt file ready to be deployed on the target.
46
47 ## Deploy application package
48
49 Run:
50
51 ```
52 $ scp *.wgt root@$BOARDIP:~/
53 $ ssh root@$BOARDIP
54 # afm-util install xxxxxx-hybrid-html5.wgt
55 # afm-util start xxxxxx-hybrid-html5@0.1
56 ```
57