From eb81d9af7c25d5fd5057d9897c2c0b6d4ea893f5 Mon Sep 17 00:00:00 2001 From: h110m Date: Tue, 16 Aug 2022 11:43:14 +0200 Subject: [PATCH] Added the option to specify a host --- src/git.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/git.ts b/src/git.ts index cb23ca4..2a46079 100644 --- a/src/git.ts +++ b/src/git.ts @@ -23,6 +23,7 @@ const services = ['upload-pack', 'receive-pack']; interface GitServerOptions extends ServerOptions { type: 'http' | 'https'; + host?: string; } export interface GitOptions { @@ -529,7 +530,7 @@ export class Git extends EventEmitter implements GitEvents { this.handle(req, res); }); - this.server.listen(port, callback); + this.server.listen(...(options?.host ? [port, options.host, callback] : [port, callback])); return this; }