feat: allow server to bind to Unix Domain Sockets

This commit is contained in:
Koen Luyten
2022-11-17 16:57:20 +01:00
committed by Joachim Van Herwegen
parent 0eb50891ec
commit bf0e35be37
15 changed files with 186 additions and 14 deletions

View File

@@ -18,6 +18,9 @@ export class BaseUrlExtractor extends ShorthandExtractor {
if (typeof args.baseUrl === 'string') {
return ensureTrailingSlash(args.baseUrl);
}
if (typeof args.socket === 'string') {
throw new Error('BaseUrl argument should be provided when using Unix Domain Sockets.');
}
const port = args.port ?? this.defaultPort;
return `http://localhost:${port}/`;
}