forked from noflo/noflo-browser-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
26 lines (24 loc) · 800 Bytes
/
app.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
const uuid = require('uuid-by-string');
const runtime = require('./runtime');
const pkg = require('./package.json');
const graph = require('./graphs/main.json');
function main() {
return runtime(graph, {
runtimeOptions: {
baseDir: pkg.name,
label: pkg.name,
namespace: pkg.name,
repository: pkg.repository ? pkg.repository.url : null,
id: uuid(window.location.href), // NOTE: you can also set a fixed UUID here to represent app
},
debugButton: document.getElementById('flowhub_debug_url'),
});
}
document.addEventListener('DOMContentLoaded', () => {
main()
.catch((err) => {
const message = document.querySelector('body p');
message.innerHTML = `ERROR: ${err.message}`;
message.parentElement.classList.add('error');
});
});