Skip to content

Commit 5646d9b

Browse files
committed
Improved logging.
1 parent e358490 commit 5646d9b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

definitions/init.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ON('ready', function() {
1616
let divider = '----------------------------------------------------';
1717
console.log(divider);
1818
console.log('Edit FlowStreams:');
19-
console.log('http://127.0.0.1:{$port}/flowstreams/?token={token}'.args(CONF));
19+
console.log(('http://127.0.0.1:{$port}/flowstreams/' + (CONF.token ? '?token={token}' : '')).args(CONF));
2020
console.log(divider);
2121
console.log();
2222
}
@@ -32,7 +32,7 @@ ON('ready', function() {
3232
var id = filename.replace(/\.json/i, '').toLowerCase();
3333
var flowstream = await F.readfile(makepath(id), 'utf8');
3434

35-
flowstream = flowstream.parseJSON(true);
35+
flowstream = flowstream.parseJSON(true) || {};
3636
flowstream.id = id;
3737

3838
Flow.load(flowstream, function(err) {
@@ -91,7 +91,7 @@ CONF.ui && ROUTE('GET /flowstreams/', function($) {
9191
} else {
9292
builder.push('<html><head><meta charset="utf-8" /><title>{0}</title></head><body style="padding:20px;font-family:Arial"><div>FlowStreams:</div><ul>'.format(CONF.name));
9393
for (let key in Flow.instances)
94-
builder.push('<li><a href="{0}" target="_blank">{1}</a></li>'.format(editor + '?socket=' + encodeURIComponent($.hostname('/flowstreams/{0}/?token={1}'.format(key, CONF.token))), key));
94+
builder.push('<li><a href="{0}" target="_blank">{1}</a></li>'.format(editor + '?socket=' + encodeURIComponent($.hostname('/flowstreams/{0}/'.format(key, CONF.token ? '?token={1}'.format(CONF.token) : ''))), key));
9595
builder.push('</ul></body></html>');
9696
$.html(builder.join('\n'));
9797
}

0 commit comments

Comments
 (0)