This commit is contained in:
Benjamin Toby
2025-04-23 13:45:48 +01:00
parent cd6bfdfc67
commit d78e44c98d
12 changed files with 42 additions and 21 deletions
+3
View File
@@ -11,6 +11,9 @@ type Param = {
env?: {
[k: string]: string;
};
remoteHost?: string;
remoteHostPort?: string;
useDefault?: boolean;
};
/**
* # Grab Names For Query
+10 -6
View File
@@ -17,12 +17,16 @@ function grabHostNames(param) {
const scheme = finalEnv["DSQL_HTTP_SCHEME"];
const localHost = finalEnv["DSQL_LOCAL_HOST"];
const localHostPort = finalEnv["DSQL_LOCAL_HOST_PORT"];
const remoteHost = ((_a = finalEnv["DSQL_API_REMOTE_HOST"]) === null || _a === void 0 ? void 0 : _a.match(/.*\..*/))
? finalEnv["DSQL_API_REMOTE_HOST"]
: undefined;
const remoteHostPort = ((_b = finalEnv["DSQL_API_REMOTE_HOST_PORT"]) === null || _b === void 0 ? void 0 : _b.match(/./))
? finalEnv["DSQL_API_REMOTE_HOST_PORT"]
: undefined;
const remoteHost = (param === null || param === void 0 ? void 0 : param.useDefault)
? undefined
: ((_a = finalEnv["DSQL_API_REMOTE_HOST"]) === null || _a === void 0 ? void 0 : _a.match(/.*\..*/))
? finalEnv["DSQL_API_REMOTE_HOST"]
: undefined;
const remoteHostPort = (param === null || param === void 0 ? void 0 : param.useDefault)
? undefined
: ((_b = finalEnv["DSQL_API_REMOTE_HOST_PORT"]) === null || _b === void 0 ? void 0 : _b.match(/./))
? finalEnv["DSQL_API_REMOTE_HOST_PORT"]
: undefined;
return {
host: remoteHost || localHost || "datasquirel.com",
port: remoteHostPort || localHostPort || 443,