Commit 51696e42 authored by Tom Jorquera's avatar Tom Jorquera

refactor client creation into its own function

This will allows to easily create multiple clients later.
parent 7a2c2ea7
......@@ -30,10 +30,16 @@ console.log('starting hublot...');
controller.loadAll('controller', 'lib', 'robot')
.then(modules => {
console.log('modules loaded... launching runner');
// Note: client returned object can be used to control further the browser
// e.g.: let c = client('room'); c.end();
const client = room => runner.run(modules,
config.visio.url,
room,
config.client);
const room = 'test-bot';
// Note: client can be used to control further the browser
// e.g.: let client = runner.run(...); client.end();
registry[room] = runner.run(modules, config.visio.url, room, config.client);
registry[room] = client(room);
})
.catch(err => {
console.error(err);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment