RuntimeTools/appmetrics-dash

passing in `options.url` to monitor causes dashboard not to show metrics

Closed this issue · 2 comments

Issue:
Passing in a HTTP server object via options.server and a non-default url via options.url is causing the metrics dashboard to be empty.


using hapi v16

const dash = require('appmetrics-dash');
...
dash.monitor({
    server: server.select('web').listener,
    url: '/new/appdash'
});

screen shot 2018-08-29 at 1 55 00 pm


Context:
there are multiple connections for this node.js app so using server.select('web').listener returns the HTTP server object for the web connection.
https://github.com/hapijs/hapi/blob/v16/API.md#serverlistener


Could it be because:

io = require('socket.io')(server, { path: '/appmetrics-dash/socket.io' });

https://github.com/RuntimeTools/appmetrics-dash/blob/master/lib/appmetrics-dash.js#L171

And instead if options.url exists, setting the path to ${options.url}/socket.io?

@s-h-a-d-o-w @mannypamintuan Sorry for not having responded sooner to this, will pick this up tomorrow in the office and get back on top of the outstanding issues and PR's