forked from qlik-oss/halyard.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
web-data.js
28 lines (19 loc) · 792 Bytes
/
web-data.js
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
const path = require('path');
const enigmaConfig = require('./enigma-config.js');
const enigma = require('enigma.js');
const enigmaMixin = require('../dist/halyard-enigma-mixin.js');
enigmaConfig.mixins = enigmaMixin;
const Halyard = require('../dist/halyard.js');
const url = 'https://www.fotbollskanalen.se/allsvenskan/';
const halyard = new Halyard();
const table = new Halyard.Table(url, { name: 'Allsvenskan', headerRowNr: 1, characterSet: 'utf8' });
halyard.addTable(table);
enigma.getService('qix', enigmaConfig).then((qix) => {
const appName = `Web-Data-${Date.now()}`;
qix.global.createAppUsingHalyard(appName, halyard).then((result) => {
console.log(`App created and reloaded - ${appName}.qvf`);
process.exit(1);
}, (err) => {
console.log(err);
});
});