Skip to content

Commit

Permalink
fix backend cli
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-marechal committed Jul 27, 2023
1 parent 0bbd6cc commit 483e0a2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/core/src/node/backend-application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ import { AddressInfo } from 'net';
import { ApplicationPackage } from '@theia/application-package';
import { ProcessUtils } from './process-utils';

export type DnsResultOrder = 'ipv4first' | 'verbatim' | 'nodeDefault';

const APP_PROJECT_PATH = 'app-project-path';

const TIMER_WARNING_THRESHOLD = 50;

const DEFAULT_PORT = environment.electron.is() ? 0 : 3000;
const DEFAULT_HOST = 'localhost';
const DEFAULT_SSL = false;
const DEFAULT_DNS_DEFAULT_RESULT_ORDER: DnsResultOrder = 'ipv4first';

export type DnsResultOrder = 'ipv4first' | 'verbatim' | 'nodeDefault';

export const BackendApplicationServer = Symbol('BackendApplicationServer');
/**
Expand Down Expand Up @@ -110,7 +112,7 @@ export class BackendApplicationCliContribution implements CliContribution {

port: number;
hostname: string | undefined;
dnsDefaultResultOrder: DnsResultOrder;
dnsDefaultResultOrder: DnsResultOrder = DEFAULT_DNS_DEFAULT_RESULT_ORDER;
ssl: boolean | undefined;
cert: string | undefined;
certkey: string | undefined;
Expand All @@ -127,7 +129,7 @@ export class BackendApplicationCliContribution implements CliContribution {
type: 'string',
description: 'Configure Node\'s DNS resolver default behavior, see https://nodejs.org/docs/latest-v18.x/api/dns.html#dnssetdefaultresultorderorder',
choices: ['ipv4first', 'verbatim', 'nodeDefault'],
default: 'ipv4first',
default: DEFAULT_DNS_DEFAULT_RESULT_ORDER
});
}

Expand Down

0 comments on commit 483e0a2

Please sign in to comment.