https://github.com/grafana/grafana-image-renderer/pull/40 diff --git a/src/app.ts b/src/app.ts index fffcd3d..b5b58f6 100644 --- a/src/app.ts +++ b/src/app.ts @@ -22,7 +22,7 @@ async function main() { const logger = new ConsoleLogger(); const browser = new Browser(logger); - const server = new HttpServer({port: argv.port}, logger, browser); + const server = new HttpServer({port: argv.port, host: argv.host}, logger, browser); server.start(); diff --git a/src/http-server.ts b/src/http-server.ts index 1aa875d..018bf6c 100644 --- a/src/http-server.ts +++ b/src/http-server.ts @@ -26,8 +26,9 @@ export class HttpServer { return res.status(err.output.statusCode).json(err.output.payload); }); - this.app.listen(this.options.port); - this.log.info(`HTTP Server started, listening on ${this.options.port}`); + this.app.listen(this.options.port, this.options.host); + const hostlabel = this.options.host ? this.options.host : ''; + this.log.info(`HTTP Server started, listening on ${hostlabel}:${this.options.port}`); } render = async (req: express.Request, res: express.Response) => {