|
|
@ -18,9 +18,11 @@ class HttpServer { |
|
|
|
/** |
|
|
|
* Constructor |
|
|
|
* @param {int} port - port used by the http server |
|
|
|
* @param {string} host - host exposing the http server |
|
|
|
*/ |
|
|
|
constructor(port) { |
|
|
|
// Initialize server port
|
|
|
|
constructor(port, host) { |
|
|
|
// Initialize server host and port
|
|
|
|
this.host = host ? host : '127.0.0.1' |
|
|
|
this.port = port |
|
|
|
|
|
|
|
// Listening server instance
|
|
|
@ -54,8 +56,8 @@ class HttpServer { |
|
|
|
}) |
|
|
|
|
|
|
|
// Start a http server
|
|
|
|
this.server = this.app.listen(this.port, () => { |
|
|
|
Logger.info('HTTP server listening on port ' + this.port) |
|
|
|
this.server = this.app.listen(this.port, this.host, () => { |
|
|
|
Logger.info(`HTTP server listening on ${this.host}:${this.port}`) |
|
|
|
}) |
|
|
|
|
|
|
|
this.server.timeout = 600 * 1000 |
|
|
|