mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
22 lines
464 B
JavaScript
22 lines
464 B
JavaScript
|
|
import Boom from 'boom';
|
|
import { Server } from 'hapi';
|
|
import { fromNode } from 'bluebird';
|
|
|
|
|
|
module.exports = class LazyServer {
|
|
constructor(host, port, optimizer) {
|
|
this.optimizer = optimizer;
|
|
this.server = new Server();
|
|
this.server.connection({
|
|
host: host,
|
|
port: port
|
|
});
|
|
}
|
|
|
|
async init() {
|
|
await this.optimizer.init();
|
|
this.optimizer.bindToServer(this.server);
|
|
await fromNode(cb => this.server.start(cb));
|
|
}
|
|
};
|